Builds the shared PCM16 mic-capture pipeline for client-owned realtime audio planes:
an AudioContext at the requested sample rate, the inline-Blob capture worklet, and a
zero-gain tail that keeps the graph pulled without audible monitoring. Each worklet block
is PCM16-encoded and handed to onPcmChunk as base64.
Extracted from the Gemini client driver (which captured fixed at 16 kHz) and
sample-rate-parameterized so providers that negotiate the input format at session start
(e.g. ElevenLabs' user_input_audio_format) capture at the negotiated rate.
Parameters
micStream: MediaStream
The caller-acquired microphone stream (the caller owns the permission UX).
sampleRate: number
The PCM16 capture sample rate in Hz (16000 for Gemini Live and the
ElevenLabs default).
onPcmChunk: (base64Pcm16:string)=>void
Invoked with each captured block as base64-encoded PCM16.
Builds the shared PCM16 mic-capture pipeline for client-owned realtime audio planes: an
AudioContextat the requested sample rate, the inline-Blob capture worklet, and a zero-gain tail that keeps the graph pulled without audible monitoring. Each worklet block is PCM16-encoded and handed toonPcmChunkas base64.Extracted from the Gemini client driver (which captured fixed at 16 kHz) and sample-rate-parameterized so providers that negotiate the input format at session start (e.g. ElevenLabs'
user_input_audio_format) capture at the negotiated rate.