how to turn hinglish text into speech with python
how to turn hinglish text into speech with python
how to turn hinglish text into speech with python
hinglish is part of everyday conversation in india. people switch between hindi and english in chats, on calls, and sometimes in the middle of a sentence. businesses can use that same mix to send delivery updates or answer support questions in language their customers are used to hearing. when those messages become audio, the text to speech model needs to follow the language switches and read the hindi in whichever script it was written in.
rumik silk supports hinglish text to speech. its muga model accepts hindi in roman letters or devanagari alongside english, so you can start with the text you already have. in this tutorial, we'll use the rumik python sdk to generate two wav files from the same message, one for each script. then we'll use the same code with a message from your app.
how to generate hinglish speech in python
step 1. install the sdk and set your api key
we'll start with the rumik sdk and a silk api key. the example uses python and sdk version 1.0.0. if you've followed the python text to speech tutorial, you already have the setup you need for step 2.
if you're starting from scratch, no worries. you can install the sdk in the same python environment you'll use to run the script.
python -m pip install "rumik-ai==1.0.0"
python -m pip install "rumik-ai==1.0.0"
create a key under api keys in the rumik playground. the sdk reads it from RUMIK_API_KEY, so replace your_api_key in the command for your shell and run the script in that same terminal.
windows powershell
$env:RUMIK_API_KEY = "your_api_key"
$env:RUMIK_API_KEY = "your_api_key"
macos or linux
export RUMIK_API_KEY="your_api_key"
export RUMIK_API_KEY="your_api_key"
step 2. send the same message in both scripts
think of this as two takes of the same line. the english stays where it is. for the second take, we transliterate the hindi from roman letters into devanagari. the script sends both versions through client.speech.create() with model="muga" and the same [neutral] tone tag.
save the code as generate_hinglish.py using utf-8 so the devanagari characters stay intact. in vs code, check the encoding in the bottom-right corner. if it already says UTF-8, save as usual. otherwise, click the encoding label, choose Save with Encoding, and select UTF-8.
from pathlib import Path from rumikai import Rumik TEXTS = { "hinglish-romanized": "aapka order confirm ho gaya hai.", "hinglish-devanagari": "आपका order confirm हो गया है.", } OUTPUT_DIR = Path(__file__).resolve().parent / "audio" def main(): OUTPUT_DIR.mkdir(parents=True, exist_ok=True) with Rumik() as client: for name, text in TEXTS.items(): audio = client.speech.create( text=f"[neutral] {text}", model="muga", temperature=0.7, ) path = OUTPUT_DIR / f"{name}.wav" audio.save(str(path)) print(f"saved {path}") if __name__ == "__main__": main()
from pathlib import Path from rumikai import Rumik TEXTS = { "hinglish-romanized": "aapka order confirm ho gaya hai.", "hinglish-devanagari": "आपका order confirm हो गया है.", } OUTPUT_DIR = Path(__file__).resolve().parent / "audio" def main(): OUTPUT_DIR.mkdir(parents=True, exist_ok=True) with Rumik() as client: for name, text in TEXTS.items(): audio = client.speech.create( text=f"[neutral] {text}", model="muga", temperature=0.7, ) path = OUTPUT_DIR / f"{name}.wav" audio.save(str(path)) print(f"saved {path}") if __name__ == "__main__": main()
when you swap in your own text, keep the wording and punctuation the same across the pair so you can focus on the script change.
step 3. run the script and compare the wav files
run the script:
python generate_hinglish.py
python generate_hinglish.py
if your terminal uses python3, use it for both the install and run commands.
each run replaces files with the same names. rename any takes you want to keep before running it again.
after both requests succeed, look for these files in the audio folder beside the script.
audio/ hinglish-romanized.wav hinglish-devanagari.wav
audio/ hinglish-romanized.wav hinglish-devanagari.wav
you can hear both versions below. the script uses the same muga model, [neutral] tone, and 0.7 temperature for both inputs.
romanized hindi with english:
aapka order confirm ho gaya hai.
devanagari hindi with english:
आपका order confirm हो गया है.
play them back to back and listen for the switch between languages around order confirm and ho gaya hai. does the whole line come through clearly in both takes? that's the comparison to make with your own messages, especially if they include a name your customers need to recognize.
test hinglish speech with your own messages
an appointment reminder is a good next test. the listener needs to catch the name, the date, and the time, even as the sentence moves between hindi and english. replace TEXTS with this one entry and run the script to save appointment-reminder.wav.
TEXTS = { "appointment-reminder": "aarav, aapki appointment 14/11/2026 ko shaam 4 baje hai.", }
TEXTS = { "appointment-reminder": "aarav, aapki appointment 14/11/2026 ko shaam 4 baje hai.", }
play appointment-reminder.wav and check that you hear aarav's name and the appointment details, 14 november 2026 at 4 pm. the input uses silk's day-first date format. if the name is hard to make out, try writing the hindi in devanagari and listen again. leave appointment in english.
if you're testing a payment message, leave a price such as ₹2,450 as written. for an otp, include double quotes around the digits in the text you send, as in "0071". that tells silk's text normalization to read each digit separately, including both zeros.
wrapping up
rumik silk is a good fit if your app sends short updates, reminders, or support replies in hinglish. the messages you already send are a good place to start.
you want to keep the way you write. if your hindi is already in roman letters, muga can read it alongside english. you can also try the same line in devanagari and hear both versions for yourself.
you want to hear it before a customer does. pick a line with a name, a time, or an amount. play it back and see whether you'd catch the detail you need on the first listen.
try a hinglish message from your app in the rumik silk playground and give it a listen.
hinglish is part of everyday conversation in india. people switch between hindi and english in chats, on calls, and sometimes in the middle of a sentence. businesses can use that same mix to send delivery updates or answer support questions in language their customers are used to hearing. when those messages become audio, the text to speech model needs to follow the language switches and read the hindi in whichever script it was written in.
rumik silk supports hinglish text to speech. its muga model accepts hindi in roman letters or devanagari alongside english, so you can start with the text you already have. in this tutorial, we'll use the rumik python sdk to generate two wav files from the same message, one for each script. then we'll use the same code with a message from your app.
how to generate hinglish speech in python
step 1. install the sdk and set your api key
we'll start with the rumik sdk and a silk api key. the example uses python and sdk version 1.0.0. if you've followed the python text to speech tutorial, you already have the setup you need for step 2.
if you're starting from scratch, no worries. you can install the sdk in the same python environment you'll use to run the script.
python -m pip install "rumik-ai==1.0.0"
create a key under api keys in the rumik playground. the sdk reads it from RUMIK_API_KEY, so replace your_api_key in the command for your shell and run the script in that same terminal.
windows powershell
$env:RUMIK_API_KEY = "your_api_key"
macos or linux
export RUMIK_API_KEY="your_api_key"
step 2. send the same message in both scripts
think of this as two takes of the same line. the english stays where it is. for the second take, we transliterate the hindi from roman letters into devanagari. the script sends both versions through client.speech.create() with model="muga" and the same [neutral] tone tag.
save the code as generate_hinglish.py using utf-8 so the devanagari characters stay intact. in vs code, check the encoding in the bottom-right corner. if it already says UTF-8, save as usual. otherwise, click the encoding label, choose Save with Encoding, and select UTF-8.
from pathlib import Path from rumikai import Rumik TEXTS = { "hinglish-romanized": "aapka order confirm ho gaya hai.", "hinglish-devanagari": "आपका order confirm हो गया है.", } OUTPUT_DIR = Path(__file__).resolve().parent / "audio" def main(): OUTPUT_DIR.mkdir(parents=True, exist_ok=True) with Rumik() as client: for name, text in TEXTS.items(): audio = client.speech.create( text=f"[neutral] {text}", model="muga", temperature=0.7, ) path = OUTPUT_DIR / f"{name}.wav" audio.save(str(path)) print(f"saved {path}") if __name__ == "__main__": main()
when you swap in your own text, keep the wording and punctuation the same across the pair so you can focus on the script change.
step 3. run the script and compare the wav files
run the script:
python generate_hinglish.py
if your terminal uses python3, use it for both the install and run commands.
each run replaces files with the same names. rename any takes you want to keep before running it again.
after both requests succeed, look for these files in the audio folder beside the script.
audio/ hinglish-romanized.wav hinglish-devanagari.wav
you can hear both versions below. the script uses the same muga model, [neutral] tone, and 0.7 temperature for both inputs.
romanized hindi with english:
aapka order confirm ho gaya hai.
devanagari hindi with english:
आपका order confirm हो गया है.
play them back to back and listen for the switch between languages around order confirm and ho gaya hai. does the whole line come through clearly in both takes? that's the comparison to make with your own messages, especially if they include a name your customers need to recognize.
test hinglish speech with your own messages
an appointment reminder is a good next test. the listener needs to catch the name, the date, and the time, even as the sentence moves between hindi and english. replace TEXTS with this one entry and run the script to save appointment-reminder.wav.
TEXTS = { "appointment-reminder": "aarav, aapki appointment 14/11/2026 ko shaam 4 baje hai.", }
play appointment-reminder.wav and check that you hear aarav's name and the appointment details, 14 november 2026 at 4 pm. the input uses silk's day-first date format. if the name is hard to make out, try writing the hindi in devanagari and listen again. leave appointment in english.
if you're testing a payment message, leave a price such as ₹2,450 as written. for an otp, include double quotes around the digits in the text you send, as in "0071". that tells silk's text normalization to read each digit separately, including both zeros.
wrapping up
rumik silk is a good fit if your app sends short updates, reminders, or support replies in hinglish. the messages you already send are a good place to start.
you want to keep the way you write. if your hindi is already in roman letters, muga can read it alongside english. you can also try the same line in devanagari and hear both versions for yourself.
you want to hear it before a customer does. pick a line with a name, a time, or an amount. play it back and see whether you'd catch the detail you need on the first listen.
try a hinglish message from your app in the rumik silk playground and give it a listen.
frequently asked questions
frequently asked questions
frequently asked questions



read other articles
read other articles
read other articles




