Skip to content

Instantly share code, notes, and snippets.

@zontan
Created October 30, 2020 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zontan/2af64ea346d02ebe034f4c588b12e74d to your computer and use it in GitHub Desktop.
Save zontan/2af64ea346d02ebe034f4c588b12e74d to your computer and use it in GitHub Desktop.
var audioEnabled = true
@IBAction func toggleMic(sender: AnyObject) {
agoraKit.muteLocalAudioStream(audioEnabled)
audioEnabled = !audioEnabled
// Update the button title
if (audioEnabled) {
self.micButton.setTitle("Mute", for: .normal)
} else {
self.micButton.setTitle("Unmute", for: .normal)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment