Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

speak with TTS such as Hindi

In my application , I wish to know if there is any tts engine that can read hindi text . my code

tts.setLanguage(Locale.US);

unfortunately Hindi is not supported by Android. See the list of Locales supported below

http://developer.android.com/reference/java/util/Locale.html

How will i do the hindi locale any help ? Thanks in advance

like image 587
peter Avatar asked May 17 '13 09:05

peter


People also ask

How do I add language to Text-to-speech?

Scroll down and tap Accessibility. Scroll down to the Screen readers section and tap Text-to-speech output. Tap Language and select a language. To use a different voice, tap the Settings icon next to Preferred engine.

Why TTS is not working in Android?

Speech Output (Text-to-Speech aka TTS) Look under Accessibility > Text-to-speech output. Ensure you have "Google Text to Speech" selected and the correct language. Note that Speaking Email won't use Samsung or other vendor voices - so you need to enable the Google voices as your default TTS engine.


1 Answers

Hindi is supported by Android -- it is just that there isn't a Locale constant for it.

If you look at http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes, then hi is the ISO 639-1 code for Hindi. Also note that Android/Java may also use the ISO 39-3 code which for Hindi is hin.

Therefore, you need to use either:

tts.setLanguage(new Locale("hi"));

or:

tts.setLanguage(new Locale("hin"));

You will also need to use a text-to-speech synthesiser that supports Hindi, otherwise you will get a "language not supported" error. The eSpeak text to speech synthesiser supports Hindi.

I have a port of eSpeak for Android 4.0 and later [1]/[2] for £0.99. This has many improvements and bug fixes over the eyes free port and is kept up-to-date with the latest eSpeak releases.

  1. http://reecedunn.co.uk/espeak-for-android
  2. https://play.google.com/store/apps/details?id=com.reecedunn.espeak
like image 109
reece Avatar answered Sep 24 '22 03:09

reece