How to Predict Failure of Google Text-to-Speech?

廉价感情. 提交于 2019-12-19 10:04:43

问题


On Android, when using a TextToSpeech instance that uses the Google text to speech engine, it seems as though the method isLanguageAvailable() is unreliable.

I say this because there are many instances where this method will return "success" (0,1,or 2), but subsequent speak() commands only results in silence.

The case I am testing is a Samsung S5 with API 23. It is in airplane mode (no network).

I'm assuming that the reason is at least partly because there is no network and therefore it can neither download and install new voices, nor use cloud-based voices.

But then shouldn't isLanguageAvailable() simply return false -- not available?

Assuming there is no network, how am I supposed to check whether a certain Locale and/or Voice is going to be "speakable" or not?

The only way I can think of is to set an utteranceProgressListener on the TextToSpeech instance, send a "test" utterance like "..." and test for an error... but this seems highly unsatisfactory!

It would be nice if there were a way to check which Voices are installed/embedded/READY TO SPEAK.

来源:https://stackoverflow.com/questions/50962724/how-to-predict-failure-of-google-text-to-speech

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!