### Example Direct Run Command Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDelayedStreamsDemoApplication.html An example of directly running the sample application with a specific configuration file. ```bash build/effects_delayed_streams_demo -c t4_denoise48k_10_cfg.txt ``` -------------------------------- ### Example Directory Structure After Installation Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/InstallTheAFXSDK.html This illustrates the expected folder structure within the Audio_Effects_SDK/features directory after a feature package, such as denoiser, has been successfully installed. ```tree $ tree Audio_Effects_SDK/features/ Audio_Effects_SDK/features/ ├── README.md ├── denoiser │ ├── include │ │ └── denoiser.h │ ├── lib │ │ ├── libnv_audiofx_denoiser.so -> libnv_audiofx_denoiser.so.2 │ │ ├── libnv_audiofx_denoiser.so.2 -> libnv_audiofx_denoiser.so.2.0.0 │ │ └── libnv_audiofx_denoiser.so.2.0.0 │ └── models │ └── sm_89 │ ├── denoiser_16k.trtpkg │ ├── denoiser_16k_6656.trtpkg │ ├── denoiser_48k.trtpkg │ ├── denoiser_48k_6656.trtpkg │ ├── denoiser_v2_16k.trtpkg │ ├── denoiser_v2_16k_7680.trtpkg │ ├── denoiser_v2_48k.trtpkg │ └── denoiser_v2_48k_3840.trtpkg ``` -------------------------------- ### Run Noise Removal Sample App on Windows Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutNoiseRemovalBackgroundNoiseSuppression.html Initial setup to download models and then run the denoiser effect demo for 16k and 48k sample rates on Windows. ```bash # (One time, initial setup): Download models using models/download_models.ps1 powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects denoiser-16k,denoiser-48k # Format: run_effect_demo.bat # 16k effect run_effect_demo.bat turing denoiser 16k 16k # 48k effect run_effect_demo.bat ampere denoiser 48k 48k ``` -------------------------------- ### Run Noise Removal Sample App on Linux Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutNoiseRemovalBackgroundNoiseSuppression.html Initial setup to download models and then run the denoiser effect demo for 16k and 48k sample rates on Linux. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects denoiser-16k,denoiser-48k # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e denoiser # 16k effect ./run_effect.sh -g t4 -s 16 -e denoiser # 48k effect ./run_effect.sh -g t4 -s 48 -e denoiser ``` -------------------------------- ### Download Models for Speaker Focus (Windows) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutSpeakerFocusEffect.html Initial setup command to download necessary models for the Speaker Focus effect on Windows. Specify your GPU architecture. ```bash # (One time, initial setup): Download models using models/download_models.ps1 powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects speaker_focus-16k,speaker_focus-48k ``` -------------------------------- ### Download Models for Speaker Focus (Linux) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutSpeakerFocusEffect.html Initial setup command to download necessary models for the Speaker Focus effect on Linux. Specify your GPU architecture. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects speaker_focus-16k,speaker_focus-48k ``` -------------------------------- ### Input WAV List Configuration Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDemoApplication.html Example of specifying multiple input WAV files for different streams and sequential processing within a stream. ```plaintext input_wav_list file1.wav file2.wav file3.wav;file4.wav;file5.wav file6.wav ``` -------------------------------- ### Download Models and Run Demo (Windows) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutRoomEchoRemovalCancellation.html Initial setup to download necessary models and then run the dereverb effect demo for 16k and 48k sample rates on Windows. ```bash # (One time, initial setup): Download models using models/download_models.ps1 powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects dereverb-16k,dereverb-48k # Format: run_effect_demo.bat # 16k effect run_effect_demo.bat turing dereverb 16k 16k # 48k effect run_effect_demo.bat ampere dereverb 48k 48k ``` -------------------------------- ### Download and Run Noise Removal/Room Echo Removal on Windows Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutNoiseRemovalRoomEchoRemoval.html Initial setup involves downloading models. Then, run the effect demo using the provided batch script, specifying the GPU architecture, effect name, and sample rates. ```bash # (One time, initial setup): Download models using models/download_models.ps1 powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects dereverb_denoiser-16k,dereverb_denoiser-48k # Format: run_effect_demo.bat # 16k effect run_effect_demo.bat turing dereverb_denoiser 16k 16k # 48k effect run_effect_demo.bat ampere dereverb_denoiser 48k 48k ``` -------------------------------- ### Download Models for Studio Voice Effect (Linux) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutStudioVoiceEffect.html One-time setup to download necessary models for the Studio Voice effect on Linux. Specify GPU and effects. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects studio_voice-16k,studio_voice-48k ``` -------------------------------- ### Get Help for Download Script Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/InstallTheAFXSDK.html Run the download script with the '--help' flag to view all available options and parameters for downloading AFX SDK features. ```powershell powershell -ExecutionPolicy Bypass -File ./download_features.ps1 --help ``` -------------------------------- ### Download Models for Voice Font Effect (Linux) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutVoiceFontEffect.html Run this one-time setup command on Linux to download the necessary models for the voice font effect. Replace `` with your GPU architecture. ```bash ./download_models.sh --gpu --effects voice_font ``` -------------------------------- ### Download Models and Run Demo (Linux) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutRoomEchoRemovalCancellation.html Initial setup to download necessary models and then run the dereverb effect demo for 16k and 48k sample rates on Linux. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects dereverb-16k,dereverb-48k # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e dereverb # 16k effect ./run_effect.sh -g t4 -s 16 -e dereverb # 48k effect ./run_effect.sh -g t4 -s 48 -e dereverb ``` -------------------------------- ### Download Models for Voice Font Effect (Windows) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutVoiceFontEffect.html Run this one-time setup command on Windows to download the necessary models for the voice font effect. Replace `` with your GPU architecture. ```powershell powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects voice_font ``` -------------------------------- ### Setup and Run AEC Effect on Linux Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutAcousticEchoCancellation.html Initial setup for running the AEC effect on Linux, including downloading models and executing the effect script. Supports 16kHz and 48kHz effects with specified GPU and sample rate. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects aec-16k,aec-48k # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e aec # 16k effect ./run_effect.sh -g t4 -s 16 -e aec # 48k effect ./run_effect.sh -g t4 -s 48 -e aec ``` -------------------------------- ### Download Models for Studio Voice Effect (Windows) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutStudioVoiceEffect.html One-time setup to download necessary models for the Studio Voice effect on Windows. Specify your GPU architecture. ```powershell # (One time, initial setup): Download models using models/download_models.ps1 powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects studio_voice-48k ``` -------------------------------- ### Install CUDA compatibility package Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/InstallTheAFXSDK.html Installs the necessary compatibility libraries for older CUDA drivers. These libraries are typically installed under `/usr/local/cuda-12.8/compat`. ```bash $ sudo apt-get install -y cuda-compat-12-8 ``` -------------------------------- ### Example: Run 16-kHz AEC Effect on Ada GPU Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/RunTheSampleApplication.html This example demonstrates how to run the 16-kHz Acoustic Echo Cancellation (AEC) effect on an Ada Lovelace GPU architecture using the helper script. ```batch run_effects_demo.bat -g ada -e aec -isr 16k -osr 16k ``` -------------------------------- ### Run AFX SDK Container Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/UseSDKInContainers.html This command starts a new Docker container, mapping a local output folder to '/host' inside the container. Ensure the output folder path does not end with a '/'. ```bash ./run_container_image.sh -m out ``` -------------------------------- ### Run Effect Sample in Container Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/UseSDKInContainers.html Executes the effects_demo sample within the AFX SDK container. This example runs the denoiser effect with a sample rate of 48kHz. The output is copied to the host-mapped directory '/host'. ```bash cd samples/effects_demo/ ./run_effect.sh -g a16 -e denoiser -s 48 cp -r denoiser/ /host/ ``` -------------------------------- ### Download Specific AFX SDK Features Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/InstallTheAFXSDK.html Download only specific AI features by listing them with the '--effects' parameter. This example downloads Superresolution and AEC features for Turing architecture. ```powershell powershell -ExecutionPolicy Bypass -File ./download_features.ps1 --gpu_architecture turing --ngc-org nvidia --ngc-team maxine --effects superres-16k_to_48k,superres-8k_to_16k,aec-16k,aec-48k ``` -------------------------------- ### Get Audio Effect Configuration Parameters Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/GetParametersOfAnEffect.html Retrieve the number of samples per input frame, the number of input channels, and the output sample rate for the audio effect. ```cpp unsigned num_samples_per_frame, num_channels, sample_rate; err = NvAFX_GetU32(handle, NVAFX_PARAM_NUM_SAMPLES_PER_INPUT_FRAME, &num_samples_per_frame); err = NvAFX_GetU32(handle, NVAFX_PARAM_NUM_INPUT_CHANNELS, &num_channels); err = NvAFX_GetU32(handle, NVAFX_PARAM_OUTPUT_SAMPLE_RATE, &sample_rate); ``` -------------------------------- ### Query Supported Samples Per Frame Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/GetParametersOfAnEffect.html Query the effect for the supported number of samples per frame. Initialize list_size to zero to get the actual size, then allocate memory and query again. ```cpp NvAFX_Status err; std::unique_ptr supported_list = nullptr; int list_size = 0; // Query with list_size set to zero to get the actual list size err = NvAFX_GetU32List(handle, NVAFX_PARAM_SUPPORTED_NUM_SAMPLES_PER_FRAME, supported_list.get(), &list_size); if (err != NVAFX_STATUS_OUTPUT_BUFFER_TOO_SMALL) { // This indicates API failure return; } // Allocate memory based on the returned size, and query with this pointer supported_list.reset(new unsigned int[list_size]); err = NvAFX_GetU32List(handle, NVAFX_PARAM_SUPPORTED_NUM_SAMPLES_PER_FRAME, supported_list.get(), &list_size); ``` -------------------------------- ### Compile the Application Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDelayedStreamsDemoApplication.html Navigate to the sample directory and run the build script to compile the application. ```bash :/Audio Effects SDK/samples/effects_delayed_streams_demo$ ./build.sh ``` -------------------------------- ### Update apt repository cache Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/InstallTheAFXSDK.html Run this command to update the package list before installing new packages. ```bash $ sudo apt-get update ``` -------------------------------- ### Run Sample Application Directly Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDelayedStreamsDemoApplication.html Execute the built sample application directly using its executable, specifying a configuration file. ```bash build/effects_delayed_streams_demo -c ``` -------------------------------- ### Run Effects Demo Application Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDemoApplication.html Execute the built sample application with a specified configuration file. ```bash build/effects_demo -c ``` -------------------------------- ### Get Number of Available GPUs Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/UseMultipleGPUs.html Call `cudaGetDeviceCount()` to determine the number of GPUs available on the system. This is the first step in managing multiple GPUs. ```c++ cuErr = cudaGetDeviceCount(&deviceCount); ``` -------------------------------- ### Get Supported Audio Devices Source: https://docs.nvidia.com/maxine/afx/latest/APIReference/AFXFunctions.html Retrieves a list of CUDA device indices compatible with the current model file. This function is not suitable for chained effects. ```c NvAFX_Status NvAFX_GetSupportedDevices( NvAFX_Handle effect, int *num, int *devices ); ``` -------------------------------- ### Run Sample Application with Helper Script Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDelayedStreamsDemoApplication.html Use the run_effect.sh helper script to execute the sample application with specified parameters, including device, sample rate, batch size, effect, and stream activation. ```bash ./run_effect.sh -g t4 -s 16 -b 10 -e denoiser -a ``` -------------------------------- ### Run Effects Demo with Specific Config Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/RunTheSampleApplication.html Execute the sample application with a specific configuration file for the denoiser effect, including the architecture. Replace with the appropriate value. ```bash effects_demo.exe -c denoise48k_cfg_.txt ``` -------------------------------- ### Run Audio Super-Resolution Demo on Linux Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutAudioSuperResolution.html Execute the sample application on Linux for the Audio Super-Resolution effect. Ensure models are downloaded first. Specify GPU, sample rate, and effect. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects superres-8k_to_16k,superres-16k_to_48k # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e superres # 16k effect ./run_effect.sh -g t4 -s 16 -e superres # 48k effect ./run_effect.sh -g t4 -s 48 -e superres ``` -------------------------------- ### Load AFX SDK DLL at Runtime (Windows) Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/BuildApplicationsWithTheSDK.html Demonstrates how to dynamically load the AFX SDK DLL and access its functions using LoadLibrary and GetProcAddress. Ensure the DLL is in a location discoverable by the system. ```cpp typedef NvAFX_Status(*NVAFX_CREATEEFFECT)(NvAFX_EffectSelector, NvAFX_Handle*); HINSTANCE h = LoadLibraryW(L"NVAudioEffects.dll"); NvAFX_CreateEffect = (NVAFX_CREATEEFFECT)GetProcAddress(h, "NvAFX_CreateEffect"); void *nv_handle; NvAFX_CreateEffect("denoiser", &nv_handle); // Similarly for other APIs FreeLibrary(h); ``` -------------------------------- ### Run Audio Super-Resolution Demo on Windows Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutAudioSuperResolution.html Execute the sample application on Windows for the Audio Super-Resolution effect. Ensure models are downloaded first. Specify GPU architecture, effect name, and sample rates. ```batch # (One time, initial setup): Download models using models/download_models.ps1 powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects superres-8k_to_16k,superres-16k_to_48k # Format: run_effect_demo.bat # 8k - 16k effect run_effect_demo.bat turing superres 8k 16k # 16k - 48k effect run_effect_demo.bat ampere superres 16k 48k ``` -------------------------------- ### Run Effects Demo with Config File Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/RunTheSampleApplication.html Execute the sample application by specifying a configuration file. The config file path is a placeholder that should be replaced with the actual path to your configuration file. ```bash effects_demo.exe -c ``` -------------------------------- ### Download and Run Noise Removal/Room Echo Removal on Linux Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutNoiseRemovalRoomEchoRemoval.html First, download the necessary models using the provided shell script. Then, execute the effect demo script with the appropriate arguments for GPU, sample rate, and effect. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects dereverb_denoiser-16k,dereverb_denoiser-48k # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e # 16k effect ./run_effect.sh -g t4 -s 16 -e dereverb_denoiser # 48k effect ./run_effect.sh -g t4 -s 48 -e dereverb_denoiser ``` -------------------------------- ### Dynamic Loading of SDK Library Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/BuildApplicationsWithTheSDK.html Dynamically load the `libnv_audiofx.so` library at runtime using `dlopen` and `dlsym`. Ensure the library path is set correctly (e.g., via `LD_LIBRARY_PATH`). ```c++ // Typedefs for functions; similarly define for other functions required typedef NvAFX_Status (*fnNvAFX_CreateEffect)(NvAFX_EffectSelector code, NvAFX_Handle* effect); // Load library and bind // Note: ensure that external/cuda/lib is in library path, or fix via RPATH/similar void* handle = dlopen("libnv_audiofx.so", RTLD_LAZY); assert(handle); fnNvAFX_CreateEffect f = (fnNvAFX_CreateEffect) dlsym(handle, "NvAFX_CreateEffect"); assert(f); // Call functions NvAFX_Handle effect; auto ret = f(NVAFX_EFFECT_DENOISER, &effect); assert(ret == NVAFX_STATUS_SUCCESS); ``` -------------------------------- ### Set Voice Font Reference Audio (Linux) Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/UseTheAFXSDKInApplications.html Sets the reference audio for selected streams for the Voice Font effect on Linux. Stream IDs start at zero. Multiple calls overwrite previous settings. ```C // Set the reference of selected streams // ID starts at zero (first stream is zero) // If this function is called multiple times, it overwrites the previously set reference std::vector stream_idx (num_streams) = {1,2}; std::vector reference_frame_ptrs(num_streams) = getRefForStreams(stream_idx); NvAFX_SetStreamFloatList(handle, NVAFX_PARAM_REFERENCE_AUDIO, stream_idx.data(), reference_frame_ptrs.data(), num_streams); ``` -------------------------------- ### Run Chained Effects with Configuration File Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/ChainMultipleEffects.html Execute the `effects_demo` application with a configuration file that specifies a chain of audio effects. This command demonstrates running the Superresolution effect followed by the Denoiser effect. ```bash effects_demo.exe -c superres16kto48k_denoise48k_chain_cfg.txt ``` -------------------------------- ### Create Chained Denoiser and Superresolution Effect Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/CreateChainedAudioEffect.html This example demonstrates how to create a chained audio effect combining Background Noise Removal (16 kHz) and Superresolution (16 kHz to 48 kHz) using the `NvAFX_CreateChainedEffect` function. ```c NvAFX_Status err = NvAFX_CreateChainedEffect(NVAFX_CHAINED_EFFECT_DENOISER_16k_SUPERRES_16k_TO_48k, &handle); ``` -------------------------------- ### Set LD_LIBRARY_PATH for AFX SDK Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDemoApplication.html Export the LD_LIBRARY_PATH environment variable to include the AFX SDK's external CUDA library directory. This ensures the application loads compatible library versions and avoids conflicts with system-wide installations. ```bash export LD_LIBRARY_PATH=external/cuda/lib:$LD_LIBRARY_PATH ``` -------------------------------- ### Run Speaker Focus Effect Demo (Windows) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutSpeakerFocusEffect.html Command to run the sample application for the Speaker Focus effect on Windows. Adjust parameters for different GPU architectures, sampling rates, and effect versions. ```bash # Format: run_effects_demo.bat -g ^ -e ^ -isr ^ -osr ^ -ir ^ -ev ^ -vad ^ # 16k effect on turing GPU run_effects_demo.bat -g turing -e speaker_focus -isr 16k -osr 16k # 48k effect on ampere GPU run_effects_demo.bat -g ampere -e speaker_focus -isr 48k -osr 48k ``` -------------------------------- ### Run Effects Demo with Helper Script Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDemoApplication.html Use the `run_effect.sh` script to execute the effects_demo application. This script generates a configuration file based on the provided arguments and then runs the demo. Specify GPU, effect, sample rates, batch size, and input files/folders. ```bash ./run_effect.sh -g -e -s -o -b -i ``` ```bash ./run_effect.sh -g t4 -s 16 -b 10 -e denoiser ``` -------------------------------- ### Fetch Supported GPU Devices on Windows Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/GetSupportedDevicesOnWindows.html Call NvAFX_GetSupportedDevices twice: first with a null buffer to get the count, then with a vector to populate it with supported CUDA device indices. This method is not supported for chained effects and must be called after setting the model path. ```cpp int numSupportedDevices = 0; NvAFX_GetSupportedDevices(handle, &numSupportedDevices, nullptr); std::vector ret(num); NvAFX_GetSupportedDevices(handle, &numSupportedDevices, ret.data); ``` -------------------------------- ### Run BNR 2.0 on Linux Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutNoiseRemovalBackgroundNoiseSuppression.html Execute the sample application for BNR 2.0 on Linux. Ensure models are downloaded first. This command runs the 16k effect. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects denoiser-16k,denoiser-48k # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e denoiser -m 2 # 16k effect ./run_effect.sh -g t4 -s 16 -e denoiser -m 2 # 48k effect ./run_effect.sh -g t4 -s 48 -e denoiser -m 2 ``` -------------------------------- ### NvAFX_InitializeLogger Source: https://docs.nvidia.com/maxine/afx/latest/AFXSDKAPIReference.html Initializes the SDK's logging system. ```APIDOC ## NvAFX_InitializeLogger ### Description Initializes the logging system for the NVIDIA AFX SDK. This should be called before any other SDK functions. ### Function Signature ```c NvAFX_API NvAFX_InitializeLogger(Logging_cb_t callback, LoggingSeverity minSeverity, LoggingTarget target); ``` ### Parameters #### Input Parameters - **callback** (Logging_cb_t) - A callback function to receive log messages. - **minSeverity** (LoggingSeverity) - The minimum severity level of messages to log. - **target** (LoggingTarget) - The target for log messages (e.g., console, file). ``` -------------------------------- ### Run Denoiser Sample with Architecture Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/RunTheSampleApplication.html Execute the denoiser sample application using a batch script, specifying the target architecture. Replace with the appropriate value (e.g., turing, ampere). ```batch run_denoiser_48k.bat -g ``` -------------------------------- ### NvAFX_GetSupportedDevices Source: https://docs.nvidia.com/maxine/afx/latest/AFXSDKAPIReference.html Retrieves a list of supported audio devices (Windows SDK only). ```APIDOC ## NvAFX_GetSupportedDevices (Windows SDK only) ### Description Retrieves a list of audio devices supported by the NVIDIA AFX SDK on Windows. ### Function Signature ```c NvAFX_API NvAFX_GetSupportedDevices(NvAFX_EffectSelector* pDeviceList, uint32_t* pNumDevices); ``` ### Parameters #### Output Parameters - **pDeviceList** (NvAFX_EffectSelector*) - Pointer to an array of NvAFX_EffectSelector structures to be filled with device information. - **pNumDevices** (uint32_t*) - Pointer to a uint32_t that will be updated with the number of supported devices found. ``` -------------------------------- ### Run Studio Voice High Quality Effect on Windows Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutStudioVoiceEffect.html Use this command to run the sample application for the Studio Voice High Quality effect on Windows. Ensure models are downloaded first. ```bash # (One time, initial setup): Download models using models/download_models.ps1 powershell -ExecutionPolicy Bypass -File ./download_models.ps1 --gpu_architecture --effects studio_voice-16k,studio_voice-48k # Format: run_effects_demo.bat -g ^ -e ^ -isr ^ -osr ^ -ir ^ -ev ^ -vad ^ # 16k effect on turing GPU run_effects_demo.bat -g turing -e studio_voice_high_quality -isr 16k -osr 16k # 48k effect on ampere GPU run_effects_demo.bat -g ampere -e studio_voice_high_quality -isr 48k -osr 48k ``` -------------------------------- ### Compile-time Linking with GCC Source: https://docs.nvidia.com/maxine/afx/latest/UseAFXInApps/BuildApplicationsWithTheSDK.html Use this method to link the core SDK library `libnv_audiofx.so` during the compilation process. Ensure the library and include paths are correctly specified. ```bash gcc -L "../../nvafx/lib" -l "nv_audiofx" -L "../../external/cuda/lib/" -I "../../nvafx/include" source.c ``` -------------------------------- ### Download All Feature Packages Including Early Access Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/InstallTheAFXSDK.html This command downloads all feature packages, including those in Early Access, for the automatically detected GPU. Ensure your NGC API key is set. ```bash ./download_features.sh --effects aec-16k,aec-48k,dereverb-16k,dereverb-48k,dereverb_denoiser-16k,dereverb_denoiser-48k,denoiser-16k,denoiser-48k,superres-8k_to_16k,superres-16k_to_48k,studio_voice-16k,studio_voice-48k,speaker_focus-16k,speaker_focus-48k,voice_font ``` -------------------------------- ### Run Studio Voice High Quality Effect on Linux Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutStudioVoiceEffect.html Use this command to run the sample application for the Studio Voice High Quality effect on Linux. Ensure models are downloaded first. ```bash # (One time, initial setup): Download models using models/download_models.sh ./download_models.sh --gpu --effects studio_voice-16k,studio_voice-48k # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e studio_voice_high_quality # 16k effect ./run_effect.sh -g t4 -s 16 -e studio_voice_high_quality # 48k effect ./run_effect.sh -g t4 -s 48 -e studio_voice_high_quality ``` -------------------------------- ### Run Studio Voice Low Latency Effect (Linux) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutStudioVoiceEffect.html Execute the sample application for the Studio Voice Low Latency effect on Linux. Specify GPU, sample rate, and effect name. ```bash # Refer to Section 3.2 for further details Format: ./run_effect.sh -g -s -e studio_voice_low_latency # 16k effect ./run_effect.sh -g t4 -s 16 -e studio_voice_low_latency # 48k effect ./run_effect.sh -g t4 -s 48 -e studio_voice_low_latency ``` -------------------------------- ### Run Studio Voice Low Latency Effect Demo (Windows) Source: https://docs.nvidia.com/maxine/afx/latest/AboutTheEffects/AboutStudioVoiceEffect.html Execute the sample application for the Studio Voice Low Latency effect on Windows. Configure GPU architecture, effect name, sample rates, intensity ratio, effect version, and VAD. ```batch # Format: run_effects_demo.bat -g ^ -e ^ -isr ^ -osr ^ -ir ^ -ev ^ -vad ^ # 16k effect on turing GPU run_effects_demo.bat -g turing -e studio_voice_low_latency -isr 16k -osr 16k # 48k effect on ampere GPU run_effects_demo.bat -g ampere -e studio_voice_low_latency -isr 48k -osr 48k ``` -------------------------------- ### General Command for run_effects_demo.bat Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/RunTheSampleApplication.html This is the general syntax for running the `run_effects_demo.bat` script. It allows specifying GPU architecture, effect, input/output sample rates, intensity ratio, effect version, and VAD enablement. ```batch run_effects_demo.bat -g -e -isr -osr -ir -ev -vad ``` -------------------------------- ### Run Effects Demo with Auto GPU Detection Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDemoApplication.html Execute the effects demo script to automatically detect the current GPU and load appropriate models for various audio effects. This is useful for quick testing and demonstration. ```bash ./run_effect.sh -s 16 -b 1 -e denoiser ./run_effect.sh -s 48 -b 1 -e dereverb ./run_effect.sh -s 16 -b 400 -e denoiser ./run_effect.sh -s 48 -b 400 -e dereverb_denoiser ./run_effect.sh -s 48 -b 400 -e aec ./run_effect.sh -s 8 -o 16 -b 400 -e superres ./run_effect.sh -s 16 -b 1 -e studio_voice_high_quality ./run_effect.sh -s 48 -b 1 -e studio_voice_high_quality ./run_effect.sh -s 48 -b 1 -e studio_voice_low_latency ./run_effect.sh -s 16 -b 1 -e speaker_focus ./run_effect.sh -s 48 -b 1 -e speaker_focus ./run_effect.sh -s 16 -b 3 -e voice_font_high_quality ./run_effect.sh -s 48 -b 3 -e voice_font_high_quality ./run_effect.sh -s 16 -b 3 -e voice_font_low_latency ./run_effect.sh -s 48 -b 3 -e voice_font_low_latency ``` -------------------------------- ### Download All Features for Detected GPU Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/InstallTheAFXSDK.html If '--gpu_architecture' is not specified, the script attempts to detect the current GPU and downloads all features (excluding Early Access) for it. ```powershell powershell -ExecutionPolicy Bypass -File ./download_features.ps1 --effects "speaker_focus-16k,speaker_focus-48k,voice_font_low_latency,voice_font_high_quality" ``` -------------------------------- ### Chaining Two Effects with Helper Script Source: https://docs.nvidia.com/maxine/afx/latest/WindowsAFXSDK/ChainMultipleEffects.html Use this command to apply two effects sequentially on audio files. Specify the GPU architecture, the first and second effects, and their respective input and output sample rates. ```bash run_effects_demo.bat -g -e -isr -osr -e2 -isr2 -osr2 ``` -------------------------------- ### Generate Configuration File Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDemoApplication.html Use the run_effect.sh script to generate a configuration file for a specific effect and sample rate. ```bash ./run_effect.sh -e aec -s 48 -g t4 -c t4_aec.cfg ``` -------------------------------- ### Download All Feature Packages (Auto-Detected GPU) Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/InstallTheAFXSDK.html This command downloads all available feature packages for the GPU detected on the system, excluding Early Access features. Ensure you have set your NGC API key first. ```bash ./download_features.sh ``` -------------------------------- ### Chaining Multiple Effects Source: https://docs.nvidia.com/maxine/afx/latest/LinuxAFXSDK/SampleApplicationsLinux/EffectsDemoApplication.html Demonstrates how to chain multiple audio effects using a shell script. This script generates a configuration file for running effects in a sequence. ```bash ./run_effect_chained.sh -g -e1 -s1 -o1 -e2 -s2 *input_sample_rate_2 -o2 output_sample_rate_2* [-c *path_to_save_config_file*] [-i input_file_or_folder] ```