Text to Speech Action (Beta)
Converts input text to spoken audio and returns the generated Base64-encoded audio
output.
This action is available in API version 66.0 and later.
Supported REST HTTP Methods
- URI
- /services/data/v66.0/actions/standard/textToSpeech
- Formats
- JSON, XML
- HTTP Methods
- POST
- Authentication
- Authorization: Bearer token
Inputs
Outputs
| OUTput | Details |
|---|---|
| convertedAudio |
|
Usage
- Sample Input
-
This sample converts text input to Base64-encoded audio using the Text to Speech action.
1{ 2 "inputs": [ 3 { 4 "inputText": "Hello! How are you?", 5 "voiceSpeed": "1", 6 "voiceStability": "0.5", 7 "voiceId": "Jbte7ht1CqapnZvc4KpK" 8 "fileOutput": true 9 } 10 ] 11} -
If fileOutput is set to false or not specified, the response returns Base64-encoded audio output.
- Sample Output
-
The response returns generated spoken audio as Base64-encoded audio data.
1{ 2 "outputs": [ 3 { 4 "audioFile": "<audio file output>", 5 "contentType": "audio/mpeg" 6 } 7 ] 8}
The response returns generated spoken audio as a file output when fileOutput is set to true.