Create an Audio Effect#
To create an audio effect, call the NvAFX_CreateEffect() function with the following parameters:
The NvAFX_EffectSelector type includes the following values:
NVAFX_EFFECT_DENOISERNVAFX_EFFECT_DEREVERBNVAFX_EFFECT_DEREVERB_DENOISERNVAFX_EFFECT_AECNVAFX_EFFECT_SUPERRESNVAFX_EFFECT_STUDIO_VOICE_HIQH_QUALITYNVAFX_EFFECT_STUDIO_VOICE_LOW_LATENCYNVAFX_EFFECT_SPEAKER_FOCUSNVAFX_EFFECT_VOICE_FONT_HIQH_QUALITYNVAFX_EFFECT_VOICE_FONT_LOW_LATENCY
The pointer to the location that stores the handle to the newly created audio effect.
The NvAFX_CreateEffect() function creates a handle to the audio effect instance for use in additional API calls.
The following example creates a denoiser audio effect:
NvAFX_Status err = NvAFX_CreateEffect(NVAFX_EFFECT_DENOISER, &handle);
Linux#
When creating an effect, the SDK attempta to load the effect library (libnv_audiofx_<effect>.so, where <effect> is the name of the feature), located in the features/<effect>/lib folder in the SDK. For example, creating an instance of the Studio Voice Low Latency effect attempts to load libnv_audiofx_studio_voice_low_latency.so, following the dynamic loader search path.
This file is normally located at features/studio_voice/libs/libnv_audiofx_studio_voice_low_latency.so (using the feature download script). If you download this file to another location, however, you can set the path by using LD_LIBRARY_PATH or similar. For example, the effects_demo and effects_delayed_streams_demo applications find all detected effects by using the RPATH of the sample application binary. Similarly, you can use LD_LIBRARY_PATH and other methods if the effect library is located in a different location.
For example, if an application has the feature library located under /usr/lib/afx, the application can use any of the following approaches:
Use
LD_LIBRARY_PATHwhen loading the application; for example,LD_LIBRARY_PATH=/usr/lib/afx:$LD_LIBRARY_PATH ./my_app.Use
RPATH/RUNPATHwhen linking the application; for example,g++ my_app.cpp .. -Wl,-rpath=/usr/lib/afx`.Register the file in the linker cache file, or use other methods that the dynamic loader/linker provides.
For further details, refer to the man pages of the Linux dynamic loader/linker (man 8 ld.so)
Windows#
When creating an effect, the SDK attempts to load the effect library (features\nvafx<effect>\bin\nvafx<effect>.dll), where <effect> is the name of the feature), located in the features/<effect>/bin folder in the SDK. For example, creating an instance of the Studio Voice Low Latency effect attempts to load nvafxstudiovoicelowlatency.dll from either the features\nvafxstudiovoicelowlatency\bin\ folder (located in the SDK root) or the same folder as the core SDK DLL.