Skip to main content
Version: 2.0.x

Mute / Unmute Mic - iOS

Muting and Unmuting your microphone refers to turning your microphone off and on, respectively.

When you mute your microphone, you prevent any sound from your microphone from being transmitted to other meeting participants, while unmuting it allows others to hear you.

unmuteMic()

  • By using unmuteMic() function of Meeting class, local participant can publish audio to other participants.

    • You can call this method when the local participant is not broadcasting any audio to others.
  • Audio stream of the participant can be accessed from the onStreamEnabled event of ParticipantEventListener.

muteMic()

  • By using muteMic() function of Meeting class, local participant can stop publish audio to other participants.

  • You can call this method when the local participant is broadcasting any audio to others.

Example

@IBAction func micButtonTapped(_ sender: Any) {
if !micEnabled {
// enable/unmute mic
self.meeting?.unmuteMic()
} else {
// disable/mute mic
self.meeting?.muteMic()
}
}

Events associated with unmuteMic

Events associated with muteMic

extension MeetingViewController: ParticipantEventListener {
//Callback for when the participant starts a stream
func onStreamEnabled(_ stream: MediaStream, forParticipant participant: Participant) {
if stream.kind = .state(value: .audio) {
print("new audio stream enabled")
}
}
//Callback for when the participant stops a stream
func onStreamDisabled(_ stream: MediaStream, forParticipant participant: Participant) {
if stream.kind = .state(value: .audio) {
print("new audio stream disabled")
}
}
}

API Reference

The API references for all the methods and events utilised in this guide are provided below.

Got a Question? Ask us on discord