Text to speech
text_to_speechConverts text into natural speech and saves it as audio files in Hindi, other Indian languages, or English. Select a voice, language, and format to generate speech from up to 50,000 characters.
Instructions
Convert text to natural speech with Bakbak and save it as an audio file on this computer. Uses Bakbak credits for every character, so call it once per text and do not retry a success. Pick a voice for the language with list_voices first and pass its id as voice_id and its model as model (a voice works only with its own model). Hindi text must be in Devanagari script. Text up to 50,000 characters; long text is split at sentence boundaries and joined into one file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>",
"language": "<language>"
},
"name": "text_to_speech"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to speak, up to 50,000 characters. Hindi must be in Devanagari script; Indian names in English text are best written in Devanagari. | |
| model | No | standard or m1. Must be the voice's model; if omitted, the chosen voice's own model is used. | |
| speed | No | Speaking rate from 0.5 to 1.5 (default 1.0). Standard voices only; m1 voices ignore it. | |
| language | Yes | Language of the text: hi, mr, te, kn, bn, as, gu, ne, ml, ta, pa, en, en-in or en-us. English m1 voices use en; standard English voices use en-in or en-us. | |
| voice_id | No | A voice id from list_voices. If omitted, the first voice for the language (and model, if given) is used. | |
| overwrite | No | Replace output_path if it already exists. Without it, an existing file is never touched. | |
| output_path | No | Where to save the file: an absolute path, or a path relative to the output directory. Its directory must exist and its extension must match the format. Default: a new file in the output directory. | |
| include_audio | No | Also return the audio inline as an audio content block. Only for audio up to 1 MB (about 20 s of the default WAV). | |
| output_format | No | The API output_format object. Default {"container":"wav","encoding":"pcm_s16le","sample_rate":24000}. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| format | Yes | ||
| language | Yes | ||
| voice_id | Yes | ||
| file_path | Yes | Absolute path of the saved audio file. | |
| characters | Yes | Characters of text synthesized (code points). | |
| request_ids | Yes | Bakbak request ids, for support. | |
| duration_seconds | Yes | Length of the audio in seconds. |