Browser-only adapter that pumps two MediaStreams into a StreamingTranscriber
configured for dual-channel mode. Each MediaStream runs through its own
pcm16-encoder AudioWorklet (resample to targetSampleRate, encode to Int16
PCM); each PCM chunk is forwarded via transcriber.sendAudio(pcm, { channel }).
All dual-channel orchestration (mixing, VAD, per-word attribution) lives inside
StreamingTranscriber — this class is a pure I/O adapter. Non-browser runtimes
can replicate its job by pushing tagged PCM into transcriber.sendAudio directly.
Caller responsibilities:
Echo cancellation is set at getUserMedia time (audio: { echoCancellation: true }).
System-audio capture is platform-dependent. Chrome's getDisplayMedia({ audio: true })
captures tab audio (and on Windows, full system audio when sharing the whole screen).
macOS requires a virtual loopback driver (e.g. BlackHole) to expose system audio at all.
Token auth. Construct the transcriber with token — API-key auth is unsupported in browsers.
Stream ownership.stop() tears down the AudioContext but does NOT stop the
MediaStreamTracks passed in — callers own those.
Wire the capture pipeline and start pumping tagged PCM into the transcriber.
The transcriber must already be connected. Returns once the worklet is
registered and the audio graph is live.
Returns Promise<void>
stop
stop(): Promise<void>
Tear down internal nodes and close the AudioContext. Does NOT stop the
caller-provided MediaStream tracks — they remain available for preview UI,
recording, etc. Idempotent.
Browser-only adapter that pumps two
MediaStreams into aStreamingTranscriberconfigured for dual-channel mode. EachMediaStreamruns through its ownpcm16-encoderAudioWorklet (resample totargetSampleRate, encode to Int16 PCM); each PCM chunk is forwarded viatranscriber.sendAudio(pcm, { channel }).All dual-channel orchestration (mixing, VAD, per-word attribution) lives inside
StreamingTranscriber— this class is a pure I/O adapter. Non-browser runtimes can replicate its job by pushing tagged PCM intotranscriber.sendAudiodirectly.Caller responsibilities:
getUserMediatime (audio: { echoCancellation: true }).getDisplayMedia({ audio: true })captures tab audio (and on Windows, full system audio when sharing the whole screen). macOS requires a virtual loopback driver (e.g. BlackHole) to expose system audio at all.token— API-key auth is unsupported in browsers.stop()tears down the AudioContext but does NOT stop theMediaStreamTracks passed in — callers own those.