unmuteMic

suspend fun unmuteMic(customMicrophoneTrack: CustomStreamTrack? = null)

Unmutes the local microphone.

Without a customMicrophoneTrack the mic is opened with the audio config this room already holds. A track's audio profile replaces that config, so it applies from this call on and to every later unmuteMic() on this room.

A rejected call releases customMicrophoneTrack, so a refused unmute never leaves the mic open. An ended track is reported on RoomEventListener.onError as code 3032 (ERROR_CUSTOM_AUDIO_TRACK_ENDED) and the mic opens with the stored config instead.

Events:

Parameters

customMicrophoneTrack

a track from VideoSDK.createMicrophoneAudioTrack, or null to use the room's stored config

See also

Throws

code 3054 (ERROR_ALREADY_IN_REQUESTED_STATE) if the mic is already on, code 3055 (ERROR_OPERATION_IN_PROGRESS) while another mic toggle or a changeMode is still running, code 3066 (ERROR_ACTION_NOT_SUPPORTED_IN_MODE) outside Mode.SEND_AND_RECV, or the microphone error — such as 3018 when RECORD_AUDIO is not granted, or 3059 when there is no microphone — which is also reported on onError.