change Mic
Switches the active audio output routing and optionally replaces the microphone audio track with a custom audio track.
This method changes the audio output device (e.g., speaker, earpiece, Bluetooth) and replaces the current microphone track with the provided customTrack if specified.
This method must be called after the meeting has been joined.
Code Example:
// Create a custom audio track with speech-optimized encoding
val audioTrack = VideoSDK.createAudioTrack("speech_standard", context)
// Switch to speaker and use the custom audio track
meeting.changeMic(AppRTCAudioManager.AudioDevice.SPEAKER_PHONE, audioTrack)
Content copied to clipboard
Parameters
device
the AppRTCAudioManager.AudioDevice to switch to (e.g., SPEAKER_PHONE, EARPIECE, BLUETOOTH, WIRED_HEADSET)
custom Track
(Optional) the CustomStreamTrack to use as the new audio source. If null, only the audio output device is changed. Create one using createAudioTrack.
See also
VideoSDK.createAudioTrack()