speak with TTS such as Hindi
Asked Answered
N

2

7

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

Newman answered 17/5, 2013 at 9:2 Comment(3)
check the below link [Localization in android for indian regional languages][1] [1]: #10944311Sharla
@Praveena_Pinki he want how to add Hindi TTS(Test to speech in hindi locale) As there is no support from google He is expecting any other 3rd party libs.Singley
yes padma kumar you are rightNewman
O
13

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
Oleograph answered 25/5, 2013 at 16:57 Comment(3)
@Oleograph Hi sir, can please help me for Kannada Language.Elementary
@Oleograph i tried (tts.setLanguage(Locale.forLanguageTag("kan")); like this but not wokingElementary
pronunciation is very different.How can i achieve it?Transcendental
P
0

You can use this package to convert Krutidev font to Unicode: krutidevtounicode and then you can give the text to tts for speaking it will speak in hindi and if not then install hindi version of tts in mobile/emulator.

var text = KrutidevToUnicode.convertToUnicode("gsyks oYMZ");
FlutterTts flutterTts = FlutterTts();
await flutterTts.speak(text);
Propagation answered 28/5, 2023 at 4:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.