1

I want to speech the words in Hindi in my application. Following this link: www.androidhive.info/2012/01/android-text-to-speech-tutorial

but there in availability of Hindi Locale. How can I make the set up for Hindi translations?

Developer
  • 67
  • 10

1 Answers1

0

You need to make a change while setting language.

t1 = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
    @Override
    public void onInit(int status) {
        if (status!=TextToSpeech.ERROR) {
            t1.setLanguage(new Locale("hin")); // Setting Hindi language
        }
    }
});

You can set the language as shown in the code above. That worked for me.

Matt Ke
  • 3,599
  • 12
  • 30
  • 49