Chain Multiple Effects#
The effects_demo sample application also provides config files in which
multiple effects are run in a chain. For more information, see Create a Chained Audio Effect.
For example, the following command runs the 16-kHz Denoiser effect followed by the 16-kHz to 48-kHz Superresolution effect on input audio. It auto-detects the GPU on x64 and selects Blackwell on NVIDIA N1X:
.\run_effects_demo.bat -e denoiser -isr 16k -osr 16k -e2 superres -isr2 16k -osr2 48k
To run effects in a chain, the configuration file uses syntax similar to the syntax used when running single effects, with the following changes:
effect <effect>
Specifies the effects in sequence to be used for chaining. For more information about possible chaining combinations, see Create a Chained Audio Effect.
Note
Chaining effects only support combinations of the Superres and the Denoiser/Dereverb/Combined Denoiser+Dereverb effect and Denoiser + Speaker Focus. Other effect chains are not supported. If combining the Denoiser effect and Dereverb effect, use the combined Denoiser+Dereverb model. For more information, see About the Noise Removal/Background Noise Suppression Effect.
model <model-file-1,model-file-2>
Specifies the path of the model files in sequence that will be used in the sample application, for example,
superres_16kto48k.trtpkg,denoiser_48k.trtpkg.
intensity_ratio <intensity-ratio-1,intensity-ratio-2>
Specifies the intensity ratio for the effects. The value of this parameter ranges from
0.0fto1.0f, where a higher value indicates a stronger suppression of noise/reverb. A value of0.0fis equivalent to a passthrough of input audio.
Use the Helper Script to Chain Multiple Effects#
Users can modify the sample config/batch files provided with the SDK and
use these files with effects_demo.exe. If the effect is to be applied on
custom input files, the files can be placed in the input sample folder
that corresponds to the effect/sample rate. Running the helper script
will apply the effect on these inputs, and the processed audio outputs
will be placed in the output folder corresponding to the effect/output
sample rate.
For example, to apply the Background Noise Removal effect on custom
48kHz files, copy the files to input_files/denoiser/48k and run
.\run_effects_demo.bat. The processed outputs will be generated in
output_files/denoiser/48k.
To apply the Background Noise Removal (Denoiser effect) + Superres
effect on 16k files, copy the files in input_files/chaining/denoiser/16k
folder and use .\run_effects_demo.bat. The outputs will be generated in
output_files/chaining/denoiser16k_superres16kto48k.
The full helper syntax is .\run_effects_demo.bat [-g <architecture>] -e
<effect_1> -isr <in_sr_1> -osr <out_sr_1> -e2 <effect_2> -isr2 <in_sr_2>
-osr2 <out_sr_2>. Replace each bracketed value with one of the following
values. Run the script from the build-produced Release\scripts directory
described in Build the Sample Application.
architecture: GPU Supported Architecture. Supported values areturing,ampere,ada, andblackwell. On NVIDIA N1X, omit-g; the helper selectsblackwellautomatically.effect_1: 1st Effect to be applied. Supported values aredenoiser,dereverb,dereverb_denoiser,superres, andspeaker_focus.in_sr_1: Input Sample Rate for 1st effect. Supported values are8k,16k, and48k.out_sr_1: Output Sample Rate for 1st effect. Supported values are16kand48k.effect_2: 2nd Effect to be applied. Supported values aredenoiser,dereverb,dereverb_denoiser, andsuperres.in_sr_2: Input Sample Rate for 2nd effect. Supported values are8k,16k, and48k.out_sr_2: Output Sample Rate for 2nd effect. Supported values are16kand48k.
The first effect’s output rate must equal the second effect’s input rate. The configured rates must also match both loaded models, and the input WAV rate must match the first model’s input rate. These checks are identical on x64 and NVIDIA N1X; a mismatch returns nonzero before an output WAV is created.
For next steps, refer to Use the Audio Effects SDK in Applications.