createMicrophoneAudioTrack static method

dynamic createMicrophoneAudioTrack({
  1. String? microphoneId,
  2. CustomAudioTrackConfig encoderConfig = CustomAudioTrackConfig.speech_standard,
  3. Map<String, bool> noiseConfig = const {},
})

Creates a microphone-based audio track with customizable encoding and noise-cancellation settings.

This method allows you to create a custom audio track using a microphone device, with support for different audio quality profiles and optional noise control configurations.

Parameters

Returns

  • A Future that resolves to a CustomTrack representing the created audio track, or null if audio track creation fails.

Example

final CustomTrack? audioTrack =
    await VideoSDK.createMicrophoneAudioTrack(
      encoderConfig: CustomAudioTrackConfig.high_quality,
    );

if (audioTrack != null) {
  print('Audio track created successfully');
}

Implementation

static createMicrophoneAudioTrack(
        {String? microphoneId,
        CustomAudioTrackConfig encoderConfig =
            CustomAudioTrackConfig.speech_standard,
        Map<String, bool> noiseConfig = const {}}) =>
    _createMicrophoneAudioTrack(
        microphoneId: microphoneId,
        encoderConfig: encoderConfig,
        noiseConfig: noiseConfig);