create_speech | R Documentation |
Generates audio from the input text.
create_speech(
input,
model,
voice,
response_format = NULL,
speed = NULL,
return_response = F
)
input |
(string) The text to generate audio for. The maximum length is 4096 characters. Required |
model |
(string) One of the available TTS models: tts-1 or tts-1-hd Required |
voice |
(string) The voice to use when generating the audio. Supported voices are alloy, echo, fable, onyx, nova, and shimmer. Required |
response_format |
(string) The format to audio in. Supported formats are mp3, opus, aac, and flac. |
speed |
(number) The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default. |
return_response |
(boolean) Whether to return the API response or parse the contents of the response. Defaults to FALSE (parse the response). |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.