How Does API Work?
The process to generate an audio file for the text input is:
- Post the request by:
- Enter the valid
REV-APPNAME, REV-APP-ID, and REV-API-KEY.
- Enter the text for which you want to obtain the speech.
- Select the output voice type (either male voice or the female voice) of the audio file.
- Define the SSML Code, if required.
- By default, the API will return the WAV audio file with a sampling rate of 22.05KHz.
cURL for Integration
Request : Synthesizing Audio for Single Sentence
Request : Synthesizing Audio for Multiple Sentences
Request : Synthesizing Audio for Multiple Sentences
Error Response
API References
HTTP Request URL
A unique key/token provided by Reverie to identify the user using the TTS API.
The unique account ID to identify the user and the default account settings.
The parameter to identify the API. The value is tts
- The desired language and voice code for synthesizing the audio file
- Example:
hi_male
- Specify the speaker’s code with respect to the language. Refer to Supporting Speaker Code section for valid speaker code.
Request
- The plain text or SSML input to synthesize an audio output.
- If you want to follow W3 standards, the ssml field must be used and not the text field.
- For SSML input Refer to the SSML Tags
- The speech rate of the audio file. Allows values: from 0.5 (slowest speed rate) up to 1.5 (fastest speed rate).
- Note: By default, speed = 1 (normal speed).
- Speaking pitch, in the range Allows values: from -3 up tp 3. 3 indicates an increase of 3 semitones from the original pitch. -3 indicates a decrease of 3 semitones from the original pitch.
- Note: By default, the pitch = 0 (zero)
- The sampling rate (in hertz) to synthesize the audio output. Refer to Supporting Sampling Rate section, to know the supporting audio sample rates.
- Note: By default, the sample_rate = 22050 Hz (22.05kHz)
- The speech audio format to generate the audio file. Refer to Supporting Audio Format section, to know the supporting audio formats.
- Note: By default, the format = WAV
Handling Error
The TTS API raises exceptions for many reasons, such as failed conversions, invalid parameters, authentication errors, and network unavailability. It will provide more specific machine-readable messages with an error response so that users can react to errors more effectively.
Refer to API Codes
to view the list of error messages and its description.
API Messages