0
我爲tts編寫簡單的程序。我想研究tts功能。我的代碼如下。如何在Android的TTS中執行addSpeech()?
String wakeUpText = "Are you up yet?";
String destFileName = "/mnt/sdcard/hello.wav";
mTts.addSpeech(wakeUpText, destFileName);
mTts.speak(wakeUpText, TextToSpeech.QUEUE_ADD, null);
你可以看到代碼非常喜歡http://developer.android.com/resources/articles/tts.html
我的問題是,如果hello.wav是不存在的,TTS不會說話。
錯誤日誌低於
DEBUG/MediaPlayer(398): java.io.IOException: Prepare failed.: status=0x1
...
DEBUG/SntpClient(70): request time failed: java.net.SocketException: Address family not supported by protocol
我該怎麼辦?