React Api Reference
    Preparing search index...

    Function createMicrophoneAudioTrack

      • This method can be used to create audio track using different encoding parameters and noise cancellation configuration.

      Parameters

      • Optionaloptions: {
            encoderConfig?:
                | "speech_low_quality"
                | "speech_standard"
                | "music_standard"
                | "standard_stereo"
                | "high_quality"
                | "high_quality_stereo";
            microphoneId?: string;
            noiseConfig?: {
                autoGainControl: boolean;
                echoCancellation: boolean;
                noiseSuppression: boolean;
            };
        }
        • OptionalencoderConfig?:
              | "speech_low_quality"
              | "speech_standard"
              | "music_standard"
              | "standard_stereo"
              | "high_quality"
              | "high_quality_stereo"

          Default: "speech_standard"

          • It will be the encoder configuration you want to use for Audio Track.
          • You can choose from the below mentioned list of values for the encoder config.
          Encoder Config Bitrate Auto Gain Echo Cancellation Noise Suppression
          speech_low_quality 16 kbps TRUE TRUE TRUE
          speech_standard 24 kbps TRUE TRUE TRUE
          music_standard 32 kbps FALSE FALSE FALSE
          standard_stereo 64 kbps FALSE FALSE FALSE
          high_quality 128 kbps FALSE FALSE FALSE
          high_quality_stereo 192 kbps FALSE FALSE FALSE
        • OptionalmicrophoneId?: string

          It will be the id of the mic from which the audio should be captured.

        • OptionalnoiseConfig?: {
              autoGainControl: boolean;
              echoCancellation: boolean;
              noiseSuppression: boolean;
          }

          Configuration for audio noise processing.

          • autoGainControl: boolean

            If true auto gain will turned on else it would be turned off.

          • echoCancellation: boolean

            If true echo cancellation will turned on else it would be turned off.

          • noiseSuppression: boolean

            If true noise suppression will turned on else it would be turned off.

      Returns Promise<MediaStream>

      import { createMicrophoneAudioTrack } from "@videosdk.live/react-sdk";

      let customTrack = await createMicrophoneAudioTrack({
      encoderConfig: "speech_standard",
      noiseConfig: {
      noiseSuppression: true,
      echoCancellation: true,
      autoGainControl: true,
      },
      });