Skip to main content
If you Base64-encode a whole .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.
If the buffer is already raw PCM, do not strip anything. Sending WAV headers as PCM hurts recognition and makes debugging harder.

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
Last modified on September 29, 2026