#How can I make the API to make a TTS call and add a pause?
1 messages · Page 1 of 1 (latest)
To add a pause in a TTS call using the API, you can use the <break> tag. This tag creates a natural pause in the speech. Here's an example of how to use it:
"Give me one second to think about it." <break time="1.0s" /> "Yes, that would work."
The time attribute should be specified in seconds, and the AI can handle pauses of up to 3 seconds in length. For more details, you can refer to the Pause section of our guide to Prompting.
How can I do this with the API? Give me the code.
To add a pause in a TTS call using the API, you can use the <break> tag. Here's an example of how you can do this:
{
"text": "Give me one second to think about it. <break time=\"1.0s\" /> Yes, that would work.",
"voice": "your_voice_id"
}
Make sure to replace "your_voice_id" with the actual voice ID you want to use. The break tag will create a natural pause in the speech. The AI can handle pauses of up to 3 seconds in length.
Can you give me the full python code?