Skip to main content
Version: Next

Function: useMicrophone()

useMicrophone(): object

Defined in: packages/mobile-client/src/overrides/hooks.ts:36

Returns

activeMicrophone

activeMicrophone: null | DeviceItem

Deprecated

Use currentMicrophone and isMicrophoneOn instead Indicates which microphone is now turned on and streaming audio

currentMicrophone

currentMicrophone: null | MediaDeviceInfo

Indicates which microphone is now selected

currentMicrophoneMiddleware

currentMicrophoneMiddleware: TrackMiddleware

The currently set microphone middleware function

isMicrophoneMuted

isMicrophoneMuted: boolean

Indicates whether the microphone is muted

isMicrophoneOn

isMicrophoneOn: boolean

Indicates whether the microphone is streaming audio

microphoneDeviceError

microphoneDeviceError: null | DeviceError

Possible error thrown while setting up the microphone

microphoneDevices

microphoneDevices: DeviceItem[]

List of available microphone devices

microphoneStream

microphoneStream: null | MediaStream

selectMicrophone()

selectMicrophone: (deviceId) => Promise<undefined | DeviceError>

Selects the microphone device

Parameters

ParameterType
deviceIdstring

Returns

Promise<undefined | DeviceError>

setMicrophoneTrackMiddleware()

setMicrophoneTrackMiddleware: (middleware) => Promise<void>

Sets the microphone middleware

Parameters

ParameterType
middlewareTrackMiddleware

Returns

Promise<void>

startMicrophone()

startMicrophone: (deviceId?) => Promise<[MediaStreamTrack, null] | [null, DeviceError]>

Starts the microphone

Parameters

ParameterType
deviceId?null | string

Returns

Promise<[MediaStreamTrack, null] | [null, DeviceError]>

stopMicrophone()

stopMicrophone: () => void

Stops the microphone

Returns

void

toggleMicrophone()

toggleMicrophone: () => Promise<undefined | DeviceError>

Toggles current microphone on/off

Returns

Promise<undefined | DeviceError>