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
| Parameter | Type |
|---|---|
deviceId | string |
Returns
Promise<undefined | DeviceError>
setMicrophoneTrackMiddleware()
setMicrophoneTrackMiddleware: (
middleware) =>Promise<void>
Sets the microphone middleware
Parameters
| Parameter | Type |
|---|---|
middleware | TrackMiddleware |
Returns
Promise<void>
startMicrophone()
startMicrophone: (
deviceId?) =>Promise<[MediaStreamTrack,null] | [null,DeviceError]>
Starts the microphone
Parameters
| Parameter | Type |
|---|---|
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>