.wav file and stream it, the RIFF header is treated as audio. Transcription quality drops, and the stream still looks valid.
Ambient and Dictation expect raw PCM (LINEAR16 / PCM_S16LE), not a WAV container. Strip the header or decode to raw PCM before Base64 encoding.
Common causes
- Encoding the full WAV file without removing the header.
- Test harnesses that treat WAV as raw PCM.
- Sending container bytes instead of PCM samples.
Fix
1
Strip the RIFF Header
For a standard RIFF WAV, remove the 44-byte header when the buffer starts with
RIFF and has WAVE at offset 8, or decode the file to raw PCM first.2
Encode Only PCM Samples
Base64-encode raw mono 16 kHz LINEAR16 / PCM_S16LE with standard Base64 (RFC 4648). Do not use hex or URL-safe Base64.
3
Use the Correct Field
On ambient
/ws/stream, put Base64 PCM in data. On Dictation /ws/transcribe, put Base64 PCM in audioData.Next steps
Build an ambient streaming client - Full client that strips WAV before stream Build a Dictation streaming client - Same strip helper for/ws/transcribe
Ambient WebSocket disconnects - Frame format and end marker issues
Dictation WebSocket handshake - audioData vs ambient data
Empty notes after end session - Poll status after a correct stream end