Skip to content

Instantly share code, notes, and snippets.

@samvarankashyap
Created November 27, 2022 00:57
Show Gist options
  • Save samvarankashyap/42e2233f9328e119af98568e2278adf4 to your computer and use it in GitHub Desktop.
Save samvarankashyap/42e2233f9328e119af98568e2278adf4 to your computer and use it in GitHub Desktop.
Telugu text to speech in python
# fedora operating system
# prereq
# pip install google_speech
# sudo dnf install sox -y
import codecs
from google_speech import Speech
telugu_padyam="""
సిరి దా వచ్చిన వచ్చును
సలలితముగ నారికేళ సలిలము భంగిన్
సిరి దాఁ బోయిన బోవును
కరిమింగిన వెలగపండు కరణిని సుమతీ!
తాత్పర్యం: సంపద వచ్చినప్పుడు కొబ్బరికాయలోకి నీరు వచ్చిన విధంగా రమ్యంగానే ఉంటుంది. అలాగే పోయినప్పుడు ఏనుగు మింగిన వెలగపండులో గుంజు మాయమైనట్లే పోతుంది.
"""
language = "te"
speed = "1.05"
speech = Speech(telugu_padyam, language)
sox_effects = ("speed", speed)
speech.play(sox_effects)
speech.save("output.mp3")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment