Streaming audio to OpenAI in your browser is cool… until you deal with PCM16.
The browser gives you Float32 audio. The API expects PCM16 at 24kHz.
That means:
Float32 → clamp → Int16 → base64 → send to realtime api
If you don’t handle the conversion properly, you’ll hear it right away — crackling, silence, or wrong pitch.
Wrote a quick guide on how to do it correctly: https://l.zfir.dev/6rbGCiN
