Prompt
text to speech api mp3 wav streaming
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
If you want a Text-to-Speech API that can return MP3/WAV and support streaming, here are the main options and how to think about them:
Common TTS APIs
- OpenAI TTS
- Google Cloud Text-to-Speech
- Amazon Polly
- Microsoft Azure Speech
- ElevenLabs
Typical audio formats
Most TTS APIs support some combination of:
- MP3 — smaller, good for web/mobile
- WAV — larger, uncompressed, good for editing/processing
- OGG/Opus — efficient streaming-friendly format
- Sometimes PCM for raw audio streams
Streaming support
“Streaming” usually means the API sends audio chunks as it is generated, instead of waiting for the whole file.
Good for streaming
- OpenAI TTS / Realtime-related audio APIs
- ElevenLabs
- Azure Speech SDK
- Amazon Polly can be streamed through SDKs
- Google TTS is often more file-oriented, but can be used efficiently with async handling
Example usage patterns
1) Standard file response
Request TTS, save response as:
mp3for playbackwavfor processing
2) Streaming response
Server sends audio as a byte stream:
- browser/client starts playback before full synthesis is complete
- useful for voice assistants and live narration
If you want a quick recommendation
- Need easiest MP3/WAV download: OpenAI, Google, Azure, Polly
- Need best streaming UX: ElevenLabs or Azure Speech SDK
- Need enterprise/cloud integration: Azure / Google / AWS
Example API design
If you’re building your own endpoint, a common pattern is:
POST /tts
Content-Type: application/json
{
"text": "Hello world",
"format": "mp3",
"stream": true
}
Response:
Content-Type: audio/mpegfor MP3Content-Type: audio/wavfor WAV
If streaming:
Transfer-Encoding: chunked- or a server-sent/streamed audio response
Simple Node.js streaming idea
app.post('/tts', async (req, res) => {
const { text } = req.body;
res.setHeader('Content-Type', 'audio/mpeg');
const audioStream = await ttsService.stream(text);
audioStream.pipe(res);
});
If you want, I can give you:
- a working example using OpenAI,
- an Express/Node streaming endpoint, or
- a browser client that plays MP3/WAV as it streams.