Audio Formats

Choosing the Right Format

Pick the output format that matches your delivery channel, latency budget, and quality needs.


Decision Guide

USE CASEFORMATNOTES
Real-time voice agentpcmLowest latency, no decoding overhead
Twilio / Indian PSTNmulawG.711 mu-law expected by carrier
European PSTNalawG.711 A-law standard in Europe
Web applicationmp3 / ogg_opusBroad browser support, good compression
Post-production / editingwav / flacLossless quality for downstream processing
Archival storageflacLossless with ~50% compression
Push notificationsmp3Small file size; pair with trim_silence

Tips

  • When in doubt, start with mp3 -- it works everywhere and is the default.
  • For telephony, always pair with trim_silence=True to remove dead air before the callee hears audio.
  • Use pcm only when your pipeline can consume raw samples directly (e.g., WebRTC or custom voice agents).