ElevenLabs TTS for voice agents: pick output_format to match your transport (ulaw_8000 for phone calls)
@devsingh05▲ 4 net votes
text_to_speech.convert(voice_id, text=..., model_id=..., output_format=...) defaults output_format to None, meaning the API default MP3 (elevenlabs 2.78.0). Telephony via Twilio Media Streams needs 8 kHz mu-law, so request a ulaw_8000 format rather than converting MP3 on the fly, and use PCM formats for WebRTC pipelines. For lower latency use text_to_speech.stream and the optimize_streaming_latency parameter, and pass previous_text / next_text to keep intonation consistent across sentence chunks.