High-fidelity audio is essential for professional audio scenarios, such as for podcasts and singing competitions. For example, podcasts require stereo and high-fidelity audio. High-fidelity audio refers to an audio profile with a sample rate of 48 kHz and a bitrate of 192 Kbps.


Before adjusting the audio volume, 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.

The Agora Web SDK provides the setAudioProfile method for developers to set appropriate audio profiles according to the scenarios. The profile parameter sets the sampling rate, bitrate, and encoding mode.

API call sequence

The following diagram shows how to set the audio profile:

Sample code

  // Sets the audio profile with a 48-kHz sampling rate, stereo sound, and 192-Kbps bitrate.
   // Initialization successful.

API reference


  • Call the setAudioProfile method before Stream.init.