Skip to main content

Interface: VoiceCapture

A source of microphone frames.

Implemented by​

Methods​

resume​

▸ resume(): void

Start capturing if the browser is holding it until a click or a key.

Returns​

void


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​

NameType
deviceIdstring
onFrame(samples: Float32Array<ArrayBufferLike>) => void
onEnded() => void

Returns​

Promise<void>


stop​

▸ stop(): void

Close the microphone. The browser's "in use" mark goes with it.

Returns​

void