2

Example:

English:

tts.speak("Welcome rubin", TextToSpeech.QUEUE_ADD, null);

It speaks correctly English in US Voice.

Hindi:

for (Voice voice: voices) {
   Log.v(TAG, voice.getName());
   if (voice.getName().equals("hi-in-x-cfn#female_2-local")) {
      tts.setVoice(new Voice(voice.getName(),
   }
}
tts.speak("स्वागत हे rubin", TextToSpeech.QUEUE_ADD, null);

It says the hindi text and english name in hindi voice.

Currently, languages supported by Google Text-to-Speech

Bangla (Bangladesh), Bangla (India), Cantonese (Hong Kong), Czech, Danish, Dutch, English (Australia), English (India), English (United Kingdom), English (United States), Estonian, Filipino, Finnish, French, German, Greek, Hindi, Hungarian, Indonesian, Italian, Japanese, Khmer, Korean, Mandarin (China), Mandarin (Taiwan), Nepali, Norwegian, Polish, Portuguese (Brazil), Romanian, Russian, Sinhala, Slovak, Spanish (Spain), Spanish (United States), Swedish, Tamil(தமிழ்) ,Thai, Turkish, Ukrainian and Vietnamese.

tts.speak("வரவேற்பு rubin", TextToSpeech.QUEUE_ADD, null);

Set<Voice> voiceList = tts.getVoices();
     for (Voice voice : voiceList) {
         Log.v(TAG, "Voice: " + voice.getName());
         if (voice.getName().equalsIgnoreCase("ta"))
            {
               Log.v(TAG, "Voice available: " + voice.getName());
               tts.setVoice(voice);
            }
     }

Am getting tamil voice in this list(voiceList) but it is showing not-installed.

It speaks the tamil word in English slang. How to set Tamil Voice and make it speak like Tamil voice??

Cœur
  • 37,241
  • 25
  • 195
  • 267
Thamim
  • 328
  • 3
  • 14
  • Have you tried checking `voice.getLocale()` for Tamil Locale in your loop? – brandall Jan 30 '18 at 19:43
  • ya.. i tired. but it's not speaking in tamil slang. – Thamim Jan 31 '18 at 05:51
  • Log the output of `voice.getLocale().toString()` so you can see all available voices for the engine. You are using `voice.getName().equalsIgnoreCase("ta")` - You show in your code that you know `getName()` provides a structure like "hi-in-x-cfn#female_2-local" so how will it ever match "ta" – brandall Jan 31 '18 at 10:30
  • TTS Demo: Voice: ta TTS Demo: Voice Locale: ta TTS Demo: Voice Locale Language: ta These are the logs.. Locale and language all are returning as "ta" – Thamim Jan 31 '18 at 10:50
  • are you sure that Tamil is actually supported for tts? I've not seen it in the list. – Clémentine Jun 26 '18 at 14:13
  • Originally tamil not supported in TTS. but when u give tamil text , it will speak in english slang. – Thamim Jul 10 '18 at 08:50
  • Any updates on this thread? I am also trying to get TTS for tamil. isLocaleAvailable is returning available but the device isn't speaking. – Varun A M Jul 23 '19 at 10:41
  • @VarunAM No.. We left tamil and proceeded with hindi and english at that time. – Thamim Jul 30 '19 at 10:11

0 Answers0