Type Definitions#

This section describes the type definitions used in the AFX SDK.

NvAFX_EffectSelector#

This type definition provides selector strings for the various audio effect types:

typedef const char* NvAFX_EffectSelector;

The currently supported selectors are:

NVAFX_EFFECT_DENOISER : "denoiser"

NVAFX_EFFECT_DEREVERB : "dereverb"

NVAFX_EFFECT_DEREVERB_DENOISER : "dereverb_denoiser"

Combined De-reverb and Denoiser effects (see About the Noise Removal/Background Noise Suppression Effect).

NVAFX_EFFECT_SUPERRES : "superres"

Audio Super-Resolution effect (see About the Audio Super-Resolution Effect).

NVAFX_EFFECT_STUDIO_VOICE_HIGH_QUALITY : "studio_voice_high_quality"

Studio Voice High Quality effect (see About the Studio Voice Effect).

NVAFX_EFFECT_STUDIO_VOICE_LOW_LATENCY : "studio_voice_low_latency"

Studio Voice Low Latency effect (see About the Studio Voice Effect).

NVAFX_EFFECT_SPEAKER_FOCUS : "speaker_focus"

Speaker Separation effect (see About the Speaker Focus Effect).

NVAFX_CHAINED_EFFECT_DENOISER_16k_SUPERRES_16k_TO_48k

Chained effect (Denoiser 16k + Superres 16k to 48k)

NVAFX_CHAINED_EFFECT_DEREVERB_16k_SUPERRES_16k_TO_48k

Chained effect (Dereverb 16k + Superres 16k to 48k)

NVAFX_CHAINED_EFFECT_DEREVERB_DENOISER_16k_SUPERRES_16k_TO_48k

Chained effect (Dereverb+Denoiser 16k + Superres 16k to 48k)

NVAFX_CHAINED_EFFECT_SUPERRES_8k_TO_16k_DENOISER_16k

Chained effect (Superres 8k to 16k + Denoiser 16k)

NVAFX_CHAINED_EFFECT_SUPERRES_8k_TO_16k_DEREVERB_16k

Chained effect (Superres 8k to 16k + Dereverb 16k)

NVAFX_CHAINED_EFFECT_SUPERRES_8k_TO_16k_DEREVERB_DENOISER_16k

Chained effect (Superres 8k to 16k + Dereverb+Denoiser 16k)

NVAFX_CHAINED_EFFECT_SPEAKER_FOCUS_16k_DENOISER_16k

Chained effect (Speaker Focus 16k + Denoiser 16k)

NVAFX_CHAINED_EFFECT_SPEAKER_FOCUS_48k_DENOISER_48k

Chained effect (Speaker Focus 48k + Denoiser 48k)

NvAFX_ParameterSelector#

This type definition provides selector strings for audio effect parameters:

typedef const char* NvAFX_ParameterSelector;

The currently supported selectors are:

NVAFX_PARAM_MODEL_PATH : "model_path"

A character string that specifies the path to the model file for the audio effect.

NVAFX_PARAM_MIC_PROFILE_MODEL : "mic_profile_model" (Studio Voice Low Latency only)

A character string that specifies the path to the microphone-profile companion model. Set this optional parameter before calling NvAFX_Load.

NVAFX_PARAM_MIC_PROFILE_ID : "mic_profile_id" (Studio Voice Low Latency only)

An unsigned integer that selects a microphone profile. Pass static_cast<unsigned int>(NVAFX_MIC_PROFILE_PASSTHROUGH) for passthrough (the default), or select a profile from NVAFX_MIC_PROFILE_BRIGHT through NVAFX_MIC_PROFILE_WARM. The supported profiles are:

Constant

ID

Profile

Character

NVAFX_MIC_PROFILE_PASSTHROUGH

-1

Passthrough

Microphone profile disabled.

NVAFX_MIC_PROFILE_BRIGHT

0

Bright

Clear and sharp, with audible detail.

NVAFX_MIC_PROFILE_VIBRANT

1

Vibrant

Rich sound with added character.

NVAFX_MIC_PROFILE_FLAT

2

Flat

Natural, balanced sound.

NVAFX_MIC_PROFILE_FULL

3

Full

Rich, deep, clear sound.

NVAFX_MIC_PROFILE_THIN

4

Thin

Light sound with less depth.

NVAFX_MIC_PROFILE_WARM

5

Warm

Soft, smooth, bass-heavy sound.

NVAFX_PARAM_INPUT_SAMPLE_RATE : "input_sample_rate"

An unsigned integer that specifies the input audio sample rate for the audio effect.

NVAFX_PARAM_OUTPUT_SAMPLE_RATE : "output_sample_rate"

An unsigned integer that specifies the output audio sample rate for the audio effect.

NVAFX_PARAM_NUM_INPUT_CHANNELS : "num_input_channels"

An unsigned integer that specifies the number of audio channels for the Audio effect.

NVAFX_PARAM_NUM_OUTPUT_CHANNELS : "num_output_channels"

An unsigned integer that specifies the number of output audio channels for the Audio effect.

NVAFX_PARAM_NUM_STREAMS : "num_streams"

An unsigned integer that specifies the number of audio streams to be processed by the audio effect.

NVAFX_PARAM_INTENSITY_RATIO : "intensity_ratio"

A float value that specifies the factor that ranges from 0.0 to 1.0. Setting the factor to 0.0 is identical to a pass through, and a value of 1.0 provides the maximum possible impact of the effect.

NVAFX_PARAM_EFFECT_VERSION : "effect_version"

An integer value that specifies which version of the effect will be used. Supported only on the Denoiser model (BNR 2.0).

NVAFX_PARAM_NUM_SAMPLES_PER_INPUT_FRAME : "num_samples_per_input_frame"

An unsigned integer that specifies the number of samples per input frame per audio stream for the audio effect.

NVAFX_PARAM_NUM_SAMPLES_PER_OUTPUT_FRAME : "num_samples_per_output_frame"

An unsigned integer that specifies the number of samples per output frame per audio stream for the audio effect.

NVAFX_PARAM_SUPPORTED_NUM_SAMPLES_PER_FRAME : "supported_num_samples_per_frame"

A list of U32 values specifying the supported values for number of samples per frame. This value can be queried before model load after the input sample rate is set.

Linux SDK only:

NVAFX_PARAM_ACTIVE_STREAMS : "active_streams"

A list of NvAFX_Bool values that specify whether the corresponding stream is active.

NVAFX_PARAM_CHAINED_EFFECT_GPU_LIST : "chained_effect_gpu_list"

A list of U32 values specifying the GPUs to be used in chained effects. Each effect in the chain will use the corresponding GPU from the list.

Windows SDK Only:

NVAFX_MODEL_CACHE_DIRECTORY : "ModelCacheDir" (Windows on Arm only)

A character string that specifies the TRT-RTX engine-cache directory. Set it before calling NvAFX_Load. If it is empty or is not set, the SDK uses a cache directory in the same directory as the model file.

NVAFX_MODEL_CACHE_MODE : "ModelCacheMode" (Windows on Arm only)

An unsigned integer that controls the TRT-RTX engine cache. Set 0 for automatic cache reuse and generation (the default), 1 to disable the cache, or 2 to force cache regeneration. Set it before calling NvAFX_Load.

NVAFX_PARAM_USER_CUDA_CONTEXT : "user_cuda_context"

An unsigned integer value that allows SDK users to disable SDK internal context management. To disable internal context management, set this value to 1. This value cannot be changed after the model is loaded for that particular session.

NVAFX_PARAM_DISABLE_CUDA_GRAPH : "disable_cuda_graph"

An unsigned integer value that specifies whether to enable CUDA graphs (enabled by default).

  • To disable CUDA graphs, set this value to 1.

  • To enable CUDA graphs, set this value to 0.

For more information about CUDA Graphs, refer to Getting Started with CUDA Graphs.

Note: NVAFX_PARAM_USE_DEFAULT_GPU and NVAFX_PARAM_USER_CUDA_CONTEXT cannot be used at the same time.

The following selectors have been deprecated:

  • NVAFX_PARAM_NUM_CHANNELS : "num_channels"

  • NVAFX_PARAM_SAMPLE_RATE : "sample_rate"

  • NVAFX_PARAM_NUM_SAMPLES_PER_FRAME : "num_samples_per_frame"

NvAFX_Handle#

An opaque handle that is associated with an instance of an audio effect:

typedef void* NvAFX_Handle;

NvAFX_Bool#

This type definition is set to NVAFX_TRUE to represent true, else NVAFX_FALSE to represent false:

typedef char NvAFX_Bool;

Logging_cb_t#

A callback function type that is used in the NvAFX_InitializeLogger API.

Linux SDK:

typedef void (*logging_cb_t)(LoggingSeverity level, const char* log,
                             void* userdata);

Windows SDK:

typedef void (*logging_cb_t)(void* user_data, const char* msg);

LoggingSeverity#

Levels of LoggingSeverity used in the NvAFX_InitializeLogger API. Refer to NvAFX_InitializeLogger for more information:

typedef enum LoggingSeverity_t {
   LOG_LEVEL_NONE = -1,
   LOG_LEVEL_FATAL = 0,
   LOG_LEVEL_ERROR = 1,
   LOG_LEVEL_WARNING = 2,
   LOG_LEVEL_INFO = 3,
} LoggingSeverity;

LoggingTarget#

Logging target used in NvAFX_InitializeLogger API. Refer to NvAFX_InitializeLogger for more information:

typedef enum LoggingTarget_t {
   LOG_TARGET_NONE = -1,
   LOG_TARGET_STDERR = 0,
   LOG_TARGET_FILE = 1,
   LOG_TARGET_CALLBACK = 2,
} LoggingTarget;