Skip to main content
Two shapes. Pick by where your audio comes from.

Push: openStream

Pull: transcribeStream

Signatures

Capturing in the renderer, transcribing in the host

The microphone lives in the renderer, where getUserMedia works. Inference lives in the utility host. Forward frames across the bridge:
Keep the conversion in the renderer. Sending raw MediaStream data across IPC per callback is far more traffic than sending the PCM you actually need.

Closing

Always flush(), finish(), and close(). A stream left open holds the model and the microphone, and on a desktop app that outlives a window close.

Choosing between them

Push suits a live microphone, since the capture API already hands you frames in a callback. Pull suits a source you can express as an async iterable, such as a file read in chunks or audio arriving over the network.