Python text to speech translation

I am working on testing text translation (from english to another language) and audio code translation using python. I am using google translate api for translation and win32 for audio. During testing, I found that Google supports https://gist.github.com/jseabold/1473363 these languages. The translation part seems to work fine for many options, but the audio part only works with a few languages ​​(English, Spanish, Italian, etc.).

as you can see in the example below, I can see that the text is translated to Hindi correctly, but I am not getting any audio output. I feel like it wincl.dispatch

doesn't support all languages ​​like google translate. furthurmore I could not find any information on the win32 api regarding the supported languages. can you help me find this listing or engilsh text for hindi audio solution?

thank

from googletrans import Translator
import win32com.client as wincl
translator = Translator()



a=translator.translate('안녕하세요.')
a=translator.translate('I am robot',src='en',dest='hi')
print (a.text)
speak = wincl.Dispatch("SAPI.SpVoice")
speak.Speak(a.text)


मैं रोबोट हूँ

Process finished with exit code 0

      

+1


source to share





All Articles