Apps need to provide different audio experiences according to different business needs. In order to provide these different audio experiences, you can use the Agora RTC SDK to set the appropriate audio profile (profile
) and audio scenario (scenario
).
This article describes how to use the Agora RTC SDK to set the audio profile and scenario in your app.
Audio profiles refer to the combined settings of the audio sample rate, bitrate, encoding mode, and number of channels; audio scenarios refer to the audio processing algorithms recommended by Agora for common business scenarios. For example, for apps in the education scenario, Agora recommends using AUDIO_SCENARIO_EDUCATION
to obtain a highly smooth and stable audio experience.
The SDK uses the AUDIO_PROFILE_DEFAULT
profile and the AUDIO_SCENARIO_DEFAULT
scenario by default. If the default settings cannot meet your requirements, you can call setAudioProfile
to set the audio profile and scenario before joining a channel.
Before setting the audio profile and scenario, ensure that you have implemented the basic real-time communication functions in your project. For details, see Start a Call or Start Live Interactive Streaming.
This section describes how to set the audio profile and scenario for common business scenarios. You can add the following sample code to your project.
This scenario mainly requires good call quality with smooth transmission. Agora recommends using the SDK default settings.
rtcEngine.setAudioProfile(AUDIO_PROFILE_DEFAULT, AUDIO_SCENARIO_DEFAULT);
This scenario mainly requires voice clarity, no noise, and a lower bitrate. Agora recommends the following settings:
rtcEngine.setAudioProfile(AUDIO_PROFILE_SPEECH_STANDARD, AUDIO_SCENARIO_CHATROOM_GAMING);
This scenario mainly requires high audio performance, with no volume or audio quality change when users mute or unmute the microphone. Agora recommends the following settings:
rtcEngine.setAudioProfile(AUDIO_PROFILE_MUSIC_STANDARD, AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT);
This scenario mainly requires high-fidelity audio, a high performance to music or singing voice, and support for rich audio effects. Agora recommends the following settings:
rtcEngine.setAudioProfile(AUDIO_PROFILE_MUSIC_HIGH_QUALITY, AUDIO_SCENARIO_GAME_STREAMING);
This scenario usually uses professional audio hardware devices and requires high-fidelity audio and stereo audio channels. Agora recommends the following settings:
rtcEngine.setAudioProfile(AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO, AUDIO_SCENARIO_SHOWROOM);
This scenario mainly requires high-fidelity audio and support for transmitting the audio effects from the local playback to remote users. Agora recommends the following settings:
rtcEngine.setAudioProfile(AUDIO_PROFILE_MUSIC_STANDARD_STEREO, AUDIO_SCENARIO_GAME_STREAMING);
This scenario mainly requires high-fidelity audio, support for rich audio effects, and no volume or audio quality change when users mute or unmute the microphone. Agora recommends the following settings:
rtcEngine.setAudioProfile(AUDIO_PROFILE_MUSIC_STANDARD_STEREO, AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT);
This section provides useful references for setting the audio profile and scenario.
Agora provides an open-source demo project AudioProfile that implements setting the audio profile and scenario on GitHub. You can download the sample project and view the source code.
The audio scenario affects the volume type. See What is the difference between the in-call volume and the media volume.