How to use Hindi(Indian Mother Tongue) language in Text-To-Speech?

老子叫甜甜 提交于 2019-11-30 16:19:36

问题


I am creating an application for student. I need to enter data in Hindi or Marathi.
When user clicks on specific topic then user should be able to listen this topic in Hindi Or Marathi.
I know How to set Language in TextToSpeech like

Tts.setLanguage(Locale.US);  

I need to set Hindi or Marathi Language. My question is that how to use Marathi or Hindi
Language in TextToSpeech. Please give me any reference or hint.


回答1:


You need a text-to-speech (TTS) engine that supports Hindi. Each TTS engine has specific languages that it supports. Here is a TTS engine that supports Hindi, but this runs on Windows. I see from the tags that you want to support this on Android. Here is a post about supporting Hindi TTS on an Android. The native TTS on Android does not support Hindi. What you may have to do is create a service that uses the Hindi text and translates it to an audio file. You would then stream the audio file to your Android application.

In my opinion though you will not want to use TTS for an educational application. I think you will find the output from the TTS very robotic and hard to understand by the students. I would record the lessons/information and just stream it in your application. Before you purchase any TTS engine I would try it out first to make sure that the generated voice is acceptable. Most of the top educational application today (ex: Khan Academy) use pre-recorded audio and/or video.




回答2:


you should use msg.lang = 'hi-IN';




回答3:


you should have to use :-

tts.setLanguage(Locale.forLanguageTag("hin-IND"));

or

tts.setLanguage(new Locale("hin","IND",null));


来源:https://stackoverflow.com/questions/10005867/how-to-use-hindiindian-mother-tongue-language-in-text-to-speech

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!