You already have a browser app that runs getUserMedia and an RTCPeerConnection. You do not have to remove it to move media onto ClutchCall. captureMicrophone keeps that exact pipeline. A loopback RTCPeerConnection runs the browser’s AEC / AGC / noise-suppression and the Opus encoder. A worker RTCRtpScriptTransform taps the encoded Opus frames. It writes them to a MoQT audio track over QUIC. WebRTC’s ICE / DTLS / SRTP transport is never used. Only its capture graph and codec are used.
This is a browser / TypeScript technique. Microphone capture is a JavaScript-only API. The browser SDK is WebTransport-only, with no WebSocket fallback rung yet. If you need a TCP/WebSocket fallback today, terminate on the server-side WebRTC leg instead. See Browser compatibility.

Tap the mic onto QUIC

  1. Connect a MoQT client with the encoded-frame rule enforced up front.
  2. Publish an audio track.
  3. Give that publication to captureMicrophone.
  4. Subscribe to the return track and decode it with OpusPlayer.

Reuse a track you already have

Your existing WebRTC app possibly called getUserMedia already, or produced a processed MediaStreamTrack. Pass that track in with track so the browser does not prompt for the microphone twice. captureMicrophone then skips acquisition and taps your track directly.
captureMicrophone throws if RTCRtpScriptTransform is absent. It does not fall back to an insecure main-thread path. The worker transform is the only encoded-frame path, and it is what lets the relay carry frame-level E2EE later. It ships in Chrome 110+, Edge, Safari, and Firefox 133+. Gate your UI with encodedTransformSupported() before you show a “call” button. Local development needs a secure context and a short-lived ECDSA cert via serverCertificateHash. Dial 127.0.0.1, not ::1.

WebRTC diversion

Why we tap WebRTC as a codec/capture layer, not a transport.

RTCRtpScriptTransform

The worker transform that diverts encoded frames.

Migrate from WebRTC

Move an existing WebRTC/SFU app onto QUIC.

Browser audio capture

The full capture + playback surface.