IllegalArgumentException: Invalid int: “OS” with Samsung tts

前端 未结 2 1594
野趣味
野趣味 2020-12-10 10:42

I\'m using Text to speech in my android application.It is working Fine with Google TTs and espeak, But when i used with Samsung TTS it gives following Exception.

         


        
2条回答
  •  无人及你
    2020-12-10 11:12

    I have found that I get this exception also when I try to do something like TextToSpeech.getDefaultVoice, or TextToSpeech.getVoices(), or TextToSpeech.getVoice(). I worked around this by not calling them, and instead working through the default Locale to get what I was trying to get via the Voices object.

    So in my case I wanted to know the Locale so I could select a language, so I did the following

                Locale lTest = Locale.getDefault();
                res = mTTS.isLanguageAvailable(lTest);
    

提交回复
热议问题