# Configure audio encoding (/en/realtime-media/broadcast-streaming/build/control-audio-and-devices/configure-audio-encoding/web)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Audio quality requirements vary with application use-case. For example, in professional use-cases such as radio stations and singing competitions, users are particularly sensitive to audio quality. In such cases, support for dual-channel and high-quality sound is required. High-quality sound means setting a high sampling rate and a high bitrate to achieve realistic audio. Video SDK enables you to configure audio encoding properties to meet such requirements.

      
  
      
  
      
  
      
    This article shows you how to use Video SDK to configure appropriate audio encoding properties and application scenarios in your app.

    ## Understand the tech [#understand-the-tech-3]

    Video SDK uses default encoding parameters and a default audio scenario that are suitable for most common applications. If the default settings do not meet your needs, refer to the examples in the implementation section to set appropriate audio encoding properties and an application scenario.

    ## Prerequisites [#prerequisites-3]

    Ensure that you have implemented the [SDK quickstart](../../index) in your project.

    ## Implementation [#implementation-3]

    The Agora Web SDK offers the following three methods to create local audio tracks:

    * `createMicrophoneAudioTrack`
    * `createBufferSourceAudioTrack`
    * `createCustomAudioTrack`

    You can adjust the audio encoding configuration by modifying the `encoderConfig` parameter in these methods. `encoderConfig` supports the following two settings:

    * Use the audio encoding properties preset by the SDK.
    * A custom object with various audio encoding parameters.

    ### Using preset audio encoding properties [#using-preset-audio-encoding-properties]

    ```javascript
    AgoraRTC.createMicrophoneAudioTrack({
     encoderConfig: "high_quality_stereo",
    }).then(/**...**/);
    ```

    ### Customizing audio encoding properties [#customizing-audio-encoding-properties]

    ```javascript
    AgoraRTC.createMicrophoneAudioTrack({
     encoderConfig: {
      sampleRate: 48000,
      stereo: true,
      bitrate: 128,
     },
    }).then(/**...**/);
    ```

    ### Development considerations [#development-considerations]

    Set the audio encoding properties before calling the `AgoraRTCClient.publish` method to publish the audio track. Once the audio track is published, its audio encoding properties cannot be modified.

    ## Reference [#reference-3]

    This section contains content that completes the information on this page, or points you to documentation that explains other aspects to this product.

    For more audio settings, see [Achieve high audio quality](/en/realtime-media/video/build/enhance-the-audio-experience/best-practices-sound-quality).

    ### Frequently asked questions [#frequently-asked-questions-3]

    * [What is the difference between the in-call volume and the media volume?](/en/api-reference/faq/integration/system_volume)

    ### API reference [#api-reference-3]

    * [`createMicrophoneAudioTrack`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createmicrophoneaudiotrack)
    * [`createBufferSourceAudioTrack`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createbuffersourceaudiotrack)
    * [`createCustomAudioTrack`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createcustomaudiotrack)

    
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
