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

ParameterTypeValue RangeDefaultRecommended Scenarios
speednumber (float)0.5 – 2.01.00.85 for language learning; 1.0 for standard narration; 1.25–1.4 for fast IVR prompts or quick message reading.

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
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
curl --location 'https://dhruva-api.bhashini.gov.in/services/inference/pipeline' \
--header 'Accept: */*' \
--header 'Authorization: YOUR_INFERENCE_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"pipelineTasks": [
{
"taskType": "tts",
"config": {
"serviceId": "",
"language": {
"sourceLanguage": "hi"
},
"gender": "female",
"speed": 1
}
}
],
"inputData": {
"input": [
{
"source": "यह त्वरित गति से बोला गया वाक्य है"
}
]
}
}'
Response
Send a request to see the live response here.

Related Guides