| 6 minutes read | Level: Advanced | Last Updated: December 2025 |
Bhashini Integration in Glific: Speech-to-Text and Text-to-Speech
Bhashini is an initiative by the Government of India aimed at making digital services and the internet accessible in all Indian languages. The integration of Bhashini into Glific enables NGOs and organizations to offer real-time translation and transliteration capabilities in various Indian languages, ensuring effective communication with end users in their preferred languages.
This integration can be especially useful in use cases such as:
- Translating chatbot content for multilingual campaigns.
- Enabling users to respond in regional languages.
- Transliteration helps convert text from one script to another, for example: writing Hindi words using English letters.
Bhashini specializes in Indic language translation and transliteration, supporting a wide range of languages and dialects. You can learn more about the platform here
Note: Bhashini integration is still in an experimental phase. While it enables powerful multilingual speech capabilities, users may occasionally notice variations in response quality or stability. As development continues, these aspects are expected to improve over time.
Steps to Integrate Bhashini Speech to Text in Glific Flows
Speech-to-Text (STT) function in Glific can be used to convert user-recorded audio messages into text. This is especially helpful when users prefer speaking over typing, or in cases where typing in local languages is difficult.
Step 1: Create a Send message node directing users to send their responses as audio messages, based on their preference.
Step 2: In the Wait for response node, select has audio as the message response type. Also, give a Result Name. In the screenshot below, speech is used as the result name.
Step 3: Add a Call Webhook node. This is where we integrate the Bhashini service.
- By default,
Functionwould be selected. Leave this as it is.
- In the
Functionfield, select the predefined function namespeech_to_text_with_bhasini, from the dropdown. This function is used to call Bhashini API for converting audio to text.
- Give the webhook result name - you can use any name. In the screenshot example, it’s named
bhashini_asr.
Step 4: Click on Function Body (top right corner). You would see the following.
Add the parameters as shown in the screenshot below.
speech: It should be updated with the result name given for the audio file captured. In this example, the variable is namedspeech(Step 2), hence the value is@results.speech.input(If the audio note captured was saved asquery, then the value will be@results.query.input)contact: Keep the value as given in the screenshot below -@contact
Step 5: Once the webhook is updated, you could always refer to the translated text as @results.bhashini_asr.asr_response_text to use it inside the flow.
Add a Send Message node and paste this variable to show the converted text to the user.
Sample Flow Click on the Sample Flow link to import it and explore how it works.
Steps to Integrate Bhashini Text To Speech in Glific Flows
Text-to-Speech (TTS) function in Glific can be used to generate a voice note for any text message, whether it's typed by the end user or written by NGO staff. This allows organizations to make information more accessible, especially for end users who prefer audio over text.
Step 1: Create a Send Message node asking users to reply in text if they prefer.
Step 2: In the Wait for Response node, select has only the phrase as the message response type. Also, give a Result Name. In the screenshot below, result_3 is used as the result name.
Step 3: Create a 'Call Webhook' node.
- By default,
Functionwould be selected. Leave this as it is.
- In the
Functionfield, select the predefined function namenmt_tts_with_bhasinifrom the dropdown. This function is used to call Bhashini API for converting text to audio.
- Give the webhook result name - you can use any name. In the screenshot example, it’s named
bhashini_tts.
Step 4: Click Function Body (top right corner). You would see the following.
Add the parameters as shown in the screenshot below.
text: It should be updated with the result name given for the response/query provided by the user.Source_language: The original language of the texttarget_language: The language in which the voice note will be generated- If translation is not needed, keep both
Source_languageandtarget_languagethe same. - Supported Target Languages:
"tamil" "kannada" "malayalam" "telugu" "assamese" "gujarati" "bengali" "punjabi" "marathi" "urdu" "spanish" "english" "hindi"
Step 5: Create a send Message node and paste the variable.
@results.bhashini_tts.media_url for the voice input. Bhashini_tts is the webhook result name used in the given example.
- Go to
Attachmentsin theSend Messagenode - Select
Expressionfrom the dropdown. - Use the following expression:
@results.bhashini_tts.media_url
Please note: In order to get the voice notes as outputs, the Glific instance must be linked to the Google Cloud Storage for your organization. This is to facilitate storage of the voice notes generated by Bhashini as a result of the webhook call. To set up Google Cloud Storage click here
Step 6: To get the translated text out, create another send message node, and call the @results.bhashini_tts.translated_text.
Sample Flow Click on the Sample Flow link to import it and explore how it works.
Using OpenAI Speech Engine for Text-to-Speech
Apart from Bhashini, the OpenAI speech engine can also be used to generate text-to-speech (TTS) responses. Since we are also experimenting with Bhashini, the response quality may sometimes be inconsistent or unreliable in a few languages.This is another alternative, users can try both options to see which gives better results for their audience and language preferences.
How to configure:
- In the
Function Body, set the speech engine toopen_ai.
Please note that, currently this alternative is supported only when both the source and target language are the same.
- Keep the remaining steps the same as those mentioned in the Text-to-Speech section above.
Blogs
Video of Showcase
Watch from 25 minute mark to watch the Bhashini integration part