Stitching multiple requests
Learn how to maintain voice prosody over multiple chunks/generations.
When converting a large body of text into audio, you may encounter abrupt changes in prosody from one chunk to another. This can be particularly noticeable when converting text that spans multiple paragraphs or sections. In order to maintain voice prosody over multiple chunks, you can use the Request Stitching feature.
This feature allows you to provide context on what has already been generated and what will be generated in the future, helping to maintain a consistent voice and prosody throughout the entire text.
Here’s an example without Request Stitching:
And the same example with Request Stitching:
How to use Request Stitching
Request Stitching is easiest when using the ElevenLabs SDKs.
Create an API key
Create an API key in the dashboard here, which you’ll use to securely access the API.
Store the key as a managed secret and pass it to the SDKs either as a environment variable via an .env
file, or directly in your app’s configuration depending on your preference.
FAQ
How does Request Stitching work with streaming?
In order to use the request IDs of a previous request for conditioning it needs to have processed completely. In case of streaming this means the audio has to be read completely from the response body.
How much difference does Request Stitching make?
The difference depends on the model, voice and voice settings used.
How old can the request IDs be?
The request IDs should be no older than two hours.
Is Request Stitching available on every plan?
Yes, unless you are an enterprise user with increased privacy requirements.