MicrophoneManager

class MicrophoneManager(val mediaManager: MediaManagerImpl, val audioUsage: Int, val audioUsageProvider: () -> 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, audioUsageProvider: () -> Int)

Properties

Link copied to clipboard
val audioBitrateProfile: StateFlow<<Error class: unknown class>>

The current audio bitrate profile

Link copied to clipboard
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

The currently selected USB input device, or null if using default routing.

Link copied to clipboard
val status: StateFlow<DeviceStatus>

The status of the audio

Link copied to clipboard

List of detected USB audio input devices.

Functions

Link copied to clipboard
Link copied to clipboard
fun cleanup()
Link copied to clipboard

Clears the USB device selection, restoring default audio routing.

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
@RequiresApi(value = 23)
fun listUsbDevices(): StateFlow<List<UsbAudioInputDevice>>

Lists all detected USB input 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

Selects a USB input device as the preferred audio input source.

Link copied to clipboard
suspend fun setAudioBitrateProfile(profile: <Error class: unknown class>): Result<Unit>

Set the audio bitrate profile. This can only be set before joining the call. Once the call is joined, changes to the audio bitrate profile will be ignored.

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

Enable or disable the microphone

Link copied to clipboard

Sets up USB audio device detection using Android's AudioDeviceCallback.