Overview
Retrieve the list of available Text-to-Speech voices provided by Google Cloud, so you can pick a specific voice_name when calling the /tts endpoint.
Query Parameters
Optional language filter (e.g. en, es, fr). When provided, only voices that support this language are returned.
Example Request
curl -X GET "https://api.gistmag.co.uk/tts/voices?language=en"
Response
The unique voice identifier (use this value as voice_name in the /tts endpoint)
List of BCP-47 language codes supported by this voice (e.g. ["en-US"])
Voice gender as defined by Google Cloud (MALE, FEMALE, NEUTRAL)
voices[].natural_sample_rate_hertz
Natural sample rate of the voice in Hz
Example Response
{
"voices": [
{
"name": "en-US-Wavenet-D",
"language_codes": ["en-US"],
"ssml_gender": "MALE",
"natural_sample_rate_hertz": 24000
},
{
"name": "en-US-Wavenet-F",
"language_codes": ["en-US"],
"ssml_gender": "FEMALE",
"natural_sample_rate_hertz": 24000
}
]
}
Usage with /tts
To use a specific voice, pass its name as the voice_name field in the /tts request body.