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.

Constructors

Methods

Constructors

Methods

  • 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>