Quick start
Supported text-to-speech models includetts-1, tts-1-hd, gpt-4o-mini-tts, doubao-tts, and seed-tts-1.1. Send text in the input field:
Voices
OpenAI supports the following values forvoice:
- alloy
- ash
- ballad
- coral
- echo
- fable
- onyx
- nova
- sage
- shimmer
voice to the name of the voice you want.
Doubao has a larger voice catalog. Choose a voice_type from Volcengine’s speech synthesis voice list and pass it as voice.
Audio formats
Setresponse_format to one of these OpenAI output formats:
mp3opuswavflacpcmaac
mp3. Doubao supports mp3, wav, pcm, and ogg_opus only.
Streaming output
By default, the response is a binary audio file. To play audio as it arrives, setstream_format to sse. Streaming is supported by gpt-4o-mini-tts, doubao-tts, and seed-tts-1.1:
For low-latency playback, use
pcm. Doubao does not support streaming in wav format.[DONE]. The format is compatible with OpenAI streaming speech synthesis.
An event with type set to speech.audio.delta contains a Base64-encoded audio fragment in audio. Decode and concatenate the fragments to save the file, or play them as you decode them:
type set to speech.audio.done marks the end of the audio. You can then close the event stream:
