For AI agents: see the complete documentation index at /llms.txt.
Achieve high audio quality
Updated
Best practices for optimal audio quality.
Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile [2/2] to set the profile to MUSIC_HIGH_QUALITY_STEREO (5). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
// Set the audio profile to MUSIC_HIGH_QUALITY_STEREO
RtcEngine.setAudioProfile(Constants.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO);// Set the audio profile to MUSIC_HIGH_QUALITY_STEREO
RtcEngine.setAudioProfile(Constants.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO)Set audio use-case
Call setAudioScenario to set the audio scenario to high-quality AUDIO_SCENARIO_GAME_STREAMING (3).
// Set the audio scenario to GAME_STREAMING
config.mAudioScenario = Constants.AudioScenario.getValue(Constants.AudioScenario.GAME_STREAMING);
engine = RtcEngine.create(config);// Set the audio scenario to GAME_STREAMING
config.mAudioScenario = Constants.AudioScenario.getValue(Constants.AudioScenario.GAME_STREAMING)
engine = RtcEngine.create(config)Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling setParameters.
// Turn off echo cancellation
engine.setParameters("{\"che.audio.aec.enable\":false}");
// Turn off noise reduction
engine.setParameters("{\"che.audio.ans.enable\":false}");
// Turn off gain control
engine.setParameters("{\"che.audio.agc.enable\":false}");// Turn off echo cancellation
engine.setParameters("{\"che.audio.aec.enable\":false}")
// Turn off noise reduction
engine.setParameters("{\"che.audio.ans.enable\":false}")
// Turn off gain control
engine.setParameters("{\"che.audio.agc.enable\":false}")Turn on stereo capture
Call setAdvancedAudioOptions to set the number of audio pre-processing channels to AGORA_AUDIO_STEREO_PROCESSING (2), that is, use two channels to collect and send stereo sound.
// Set advanced audio options for 2 audio processing channels
AdvancedAudioOptions options = new AdvancedAudioOptions();
options.audioProcessingChannels = 2;
m_lpAgoraEngine.setAdvancedAudioOptions(options);// Set advanced audio options for 2 audio processing channels
val options = AdvancedAudioOptions()
options.audioProcessingChannels = 2
m_lpAgoraEngine.setAdvancedAudioOptions(options)Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile [2/2] to set the audio profile to AgoraAudioProfileMusicHighQuality (4). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
(int) setAudioProfile : (AgoraAudioProfile) profile;Set audio scenario
Call setAudioScenario to set the audio scenario to high-quality AUDIO_SCENARIO_GAME_STREAMING (3).
(int) setAudioScenario : (AgoraAudioScenario) scenario;Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling setParameters.
setParameters("{\"che.audio.aec.enable\":false}") // Turn off echo cancellation
setParameters("{\"che.audio.ans.enable\":false}") // Turn off noise reduction
setParameters("{\"che.audio.agc.enable\":false}") // Turn off gain controlTurn on stereo capture
Call setAdvancedAudioOptions to set the number of audio pre-processing channels to AGORA_AUDIO_STEREO_PROCESSING (2), that is, use two channels to collect and send stereo sound.
(int) setAdvancedAudioOptions : (AgoraAdvancedAudioOptions * _Nonnull) options;Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile [2/2] to set the audio profile to AgoraAudioProfileMusicHighQuality(4). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
(int) setAudioProfile : (AgoraAudioProfile) profile;Set audio scenario
Call setAudioScenario to set the audio scenario to high-quality AUDIO_SCENARIO_GAME_STREAMING(3).
(int) setAudioScenario : (AgoraAudioScenario) scenario;Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling setParameters.
setParameters("{\"che.audio.aec.enable\":false}") // Turn off echo cancellation
setParameters("{\"che.audio.ans.enable\":false}") // Turn off noise reduction
setParameters("{\"che.audio.agc.enable\":false}") // Turn off gain controlTurn on stereo capture
Call setAdvancedAudioOptions to set the number of audio pre-processing channels to AGORA_AUDIO_STEREO_PROCESSING(2), that is, use two channels to collect and send stereo sound.
(int) setAdvancedAudioOptions : (AgoraAdvancedAudioOptions * _Nonnull) options;Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Using default audio encoding
Call createMicrophoneAudioTrack and in encoderConfig pass "high_quality_stereo", Video SDK's built-in audio encoding configuration. It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
AgoraRTC.createMicrophoneAudioTrack({
encoderConfig: "high_quality_stereo"
}).then(/**...**/);Custom audio encoding
Use the following code example to customize audio encoding properties. This example sets a 48 kHz sampling rate, music encoding, two-channel usage, and a maximum encoding rate of 128 Kbps.
AgoraRTC.createMicrophoneAudioTrack({
encoderConfig: {
sampleRate: 48000,
stereo: true,
bitrate: 128,
},
}).then(/**...**/);Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable 3A by calling createMicrophoneAudioTrack.
AgoraRTC.createMicrophoneAudioTrack({
AEC: false, // Turn off echo cancellation
AGC: false, // Turn off gain control
ANS: false, // Turn off noise reduction
}).then(/**...**/);Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile [2/2] to set the audio profile to AudioProfileMusicHighQuality (4) and scenario to AUDIO_PROFILE_MUSIC_HIGH_QUALITY (4). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile) = 0;Set audio scenario
Call setAudioScenario to set the audio scenario to high-quality AUDIO_SCENARIO_GAME_STREAMING (3).
virtual int setAudioScenario(AUDIO_SCENARIO_TYPE scenario) = 0;Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling setParameters.
setParameters("{\"che.audio.aec.enable\":false}") // Turn off echo cancellation
setParameters("{\"che.audio.ans.enable\":false}") // Turn off noise reduction
setParameters("{\"che.audio.agc.enable\":false}") // Turn off gain controlTurn on stereo capture
Call setAdvancedAudioOptions to set the number of audio pre-processing channels to AudioProcessingStereo (2), that is, use two channels to collect and send stereo sound.
Call this method before calling joinChannel, enableAudio, and enableLocalAudio.
virtual int setAdvancedAudioOptions(media::base::AdvancedAudioOptions &options) = 0;Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile to set the profile to AudioProfileMusicHighQuality (4) and scenario to AudioScenarioGameStreaming (3). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
abstract setAudioProfile(
profile: AudioProfileType,
scenario?: AudioScenarioType
): number;Set audio scenario
Call setAudioScenario to set the audio scenario to high-quality AUDIO_SCENARIO_GAME_STREAMING (3).
abstract setAudioScenario(scenario: AudioScenarioType): number;Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling setParameters.
setParameters("{\"che.audio.aec.enable\":false}") // Turn off echo cancellation
setParameters("{\"che.audio.ans.enable\":false}") // Turn off noise reduction
setParameters("{\"che.audio.agc.enable\":false}") // Turn off gain controlTurn on stereo capture
Call setAdvancedAudioOptions to set the number of audio pre-processing channels to AudioProcessingStereo (2), that is, use two channels to collect and send stereo sound.
abstract setAdvancedAudioOptions(options: AdvancedAudioOptions): number;Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile to set the audio profile to audioProfileMusicHighQuality (4). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
Future<void> setAudioProfile(
{required AudioProfileType profile,
AudioScenarioType scenario = AudioScenarioType.audioScenarioDefault});Set audio scenario
Call setAudioScenario to set the audio scenario to high-quality audioScenarioGameStreaming (3).
Future<void> setAudioScenario(AudioScenarioType scenario);Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling setParameters.
setParameters("{\"che.audio.aec.enable\":false}") // Turn off echo cancellation
setParameters("{\"che.audio.ans.enable\":false}") // Turn off noise reduction
setParameters("{\"che.audio.agc.enable\":false}") // Turn off gain controlTurn on stereo capture
Call setAdvancedAudioOptions to set the number of audio pre-processing channels to AGORA_AUDIO_STEREO_PROCESSING (2), that is, use two channels to collect and send stereo sound.
Call this method before calling joinChannel, enableAudio, and enableLocalAudio.
Future<void> setAdvancedAudioOptions(AdvancedAudioOptions options);Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your app.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile to set the audio profile to AudioProfileMusicHighQuality (4). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
abstract setAudioProfile(
profile: AudioProfileType,
scenario?: AudioScenarioType
): number;Set audio scenario
Call setAudioScenario to set the audio scenario to high-quality AudioScenarioGameStreaming (3).
abstract setAudioScenario(scenario: AudioScenarioType): number;Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling setParameters.
setParameters("{\"che.audio.aec.enable\":false}") // Turn off echo cancellation
setParameters("{\"che.audio.ans.enable\":false}") // Turn off noise reduction
setParameters("{\"che.audio.agc.enable\":false}") // Turn off gain controlTurn on stereo capture
Call setAdvancedAudioOptions to set the number of audio pre-processing channels to AGORA_AUDIO_STEREO_PROCESSING (2), that is, use two channels to collect and send stereo sound.
abstract setAdvancedAudioOptions(options: AdvancedAudioOptions): number;Some use-cases, such as karaoke sessions, podcasts, and performance-based chats, require a high-quality audio experience. This page shows you how to achieve clear high-definition audio, without noise or interference in your game.
General settings
To improve the audio quality experience, consider the following:
Set audio encoding properties
Call setAudioProfile [2/2] to set the audio profile to MUSIC_HIGH_QUALITY_STEREO (5). It uses a 48 kHz sampling rate, music encoding, two channels, and the maximum encoding rate is 128 Kbps.
public abstract int SetAudioProfile(AUDIO_PROFILE_TYPE profile);Set audio scenario
Call setAudioScenario to set the audio scenario to high-quality AUDIO_SCENARIO_GAME_STREAMING (3).
public abstract int SetAudioScenario(AUDIO_SCENARIO_TYPE scenario);Sound card settings
This section only applies to users using sound cards.
Disable 3A
Video SDK turns on 3A by default. In audio processing, 3A stands for Acoustic Echo Cancellation (AEC), Active Noise Suppression (ANS), and Automatic Gain Control (AGC). Sound card devices usually provide some built-in audio processing, such as echo and noise cancellation. Currently, if 3A is enabled in the application layer, it may cause over-processing of the audio signal and interference between different algorithms may impact sound quality. Best practice is that users with sound cards disable the 3A function by calling SetParameters.
SetParameters("{\"che.audio.aec.enable\":false}") // Turn off echo cancellation
SetParameters("{\"che.audio.ans.enable\":false}") // Turn off noise reduction
SetParameters("{\"che.audio.agc.enable\":false}") // Turn off gain controlTurn on stereo capture
Call SetAdvancedAudioOptions to set the number of audio pre-processing channels to AGORA_AUDIO_STEREO_PROCESSING (2), that is, use two channels to collect and send stereo sound.
public abstract int SetAdvancedAudioOptions(AdvancedAudioOptions options);