Class: MicrophoneCapture
The player's microphone, through the browser's own echo cancelling, noise suppression and gain control, as 20 ms frames.
Implements
Constructors
constructor
• new MicrophoneCapture(): MicrophoneCapture
Returns
Methods
resume
▸ resume(): void
Start capturing if the browser is holding it until a click or a key.
Returns
void
Implementation of
start
▸ start(deviceId, onFrame, onEnded): Promise<void>
Open the microphone and start handing 20 ms frames of mono samples at
48 kHz to onFrame. Rejects with a VoiceCaptureError.
Parameters
| Name | Type |
|---|---|
deviceId | string |
onFrame | (samples: Float32Array<ArrayBufferLike>) => void |
onEnded | () => void |
Returns
Promise<void>
Implementation of
stop
▸ stop(): void
Close the microphone. The browser's "in use" mark goes with it.
Returns
void