MicrophoneManager

class MicrophoneManager(val mediaManager: MediaManagerImpl, val audioUsage: Int)

The Microphone manager makes it easy to use your microphone in a call

Samples

Constructors

Link copied to clipboard
constructor(mediaManager: MediaManagerImpl, audioUsage: Int)

Properties

Link copied to clipboard
Link copied to clipboard
val devices: StateFlow<List<StreamAudioDevice>>

List of available devices.

Link copied to clipboard
val isEnabled: StateFlow<Boolean>

Represents whether the audio is enabled

Link copied to clipboard
Link copied to clipboard

Currently selected device

Link copied to clipboard
val status: StateFlow<DeviceStatus>

The status of the audio

Functions

Link copied to clipboard
Link copied to clipboard
fun cleanup()
Link copied to clipboard
fun disable(fromUser: Boolean = true)

Disable the audio track. Audio is still captured, but not send. This allows for the "you are muted" toast to indicate you are talking while muted

Link copied to clipboard

List the devices, returns a stateflow with audio devices

Link copied to clipboard
fun pause(fromUser: Boolean = true)
Link copied to clipboard
fun resume(fromUser: Boolean = true)
Link copied to clipboard

Select a specific device

Link copied to clipboard
fun setEnabled(enabled: Boolean, fromUser: Boolean = true)

Enable or disable the microphone