Skip to main content

Generate Voice

This endpoint allows you to convert text into speech using the Whisperly TTS service. You can optionally provide a speaker sample (WAV file) to guide the voice synthesis process.

Request

URL:
POST /generate-voice

Headers:
Authorization: Bearer <TOKEN>

Request Body Parameters

The request must include the following form data parameters:

  • text (required): The text to be converted into speech.
  • speaker_wav (optional): A WAV file used as a speaker sample. Upload using form-data file field.
  • language (optional, default: "en"): The language for the generated voice.
  • file_path (optional, default: "output.wav"): The desired output filename for the generated audio.
  • speed (optional, default: "1.0"): The speed factor for the voice output.
  • split_sentences (optional, default: "true"): Whether to split the text into sentences before processing.

Example Request

curl --location 'https://tts.recordly.ai/generate-voice' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'text="Lorem Ipsum"' \
--form 'speaker_wav=@"/path/to/file/speaker.wav"' \
--form 'language="en"' \
--form 'file_path="output.wav"' \
--form 'speed="2.0"' \
--form 'split_sentences="false"'

Response

If the request is successful, the response will include audio file.