Speed Changing
Bhashini Text-to-Speech (TTS) models allow developers to modulate speech delivery tempo. Whether you are generating faster audio for conversational interactive voice response (IVR) menus or slower pacing for educational and accessibility tools, speech speed can be parameterized dynamically in the inference request.
Modulating Speech Speed
The speed parameter resides inside the config object of the tts pipeline task. It accepts a floating-point number where 1.0 represents the natural recording baseline.
Config with speed
{
"pipelineTasks": [
{
"taskType": "tts",
"config": {
"language": {
"sourceLanguage": "hi"
},
"serviceId": "ai4bharat/indic-tts-coqui-indo_aryan-gpu--t4",
"gender": "female",
"speed": 1.25
}
}
],
"inputData": {
"input": [
{
"source": "यह त्वरित गति से बोला गया वाक्य है।"
}
]
}
}Parameter Specification
| Parameter | Type | Value Range | Default | Recommended Scenarios |
|---|---|---|---|---|
speed | number (float) | 0.5 – 2.0 | 1.0 | 0.85 for language learning; 1.0 for standard narration; 1.25–1.4 for fast IVR prompts or quick message reading. |
Tip
Setting speed outside the 0.5 to 2.0 range may cause unnatural pitch distortion or phoneme clipping depending on the underlying acoustic vocoder.
Code Examples
const url = 'https://dhruva-api.bhashini.gov.in/services/inference/pipeline';
const payload = {
pipelineTasks: [
{
taskType: 'tts',
config: {
language: { sourceLanguage: 'hi' },
serviceId: '<TTS_SERVICE_ID>',
gender: 'female',
speed: 1.25 // 0.5 to 2.0
}
}
],
inputData: {
input: [{ source: 'नमस्ते! यह सामान्य गति से थोड़ा तेज़ है।' }]
}
};
const res = await fetch(url, {
method: 'POST',
headers: {
'Authorization': '<YOUR_INFERENCE_API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
const data = await res.json();
const audioBase64 = data.pipelineResponse[0].audio[0].audioContent;
const audio = new Audio(`data:audio/wav;base64,${audioBase64}`);
audio.play();Live Interactive Tryout
Use the speed slider in the runner below to synthesize speech across various playback rates:
Adjust Speech Speed
Configure playback speed from 0.5x to 2.0x in real-time
Request
Select model
हिन्दी | Hindi
Below 1 is slower and more deliberate, above 1 is quicker. Ignored by services that do not support it.
Add an inference API key to run.
curl
Response
Send a request to see the live response here.
Related Guides
- TTS Quickstart — Overview of Bhashini TTS capabilities and keys.
- Voice Changing — Switch between female and male voices.
- TTS Capability Suite — Complete request/response schema specifications.