我正在使用TTS引擎将文本转换为语音,我想暂停TTS语音并恢复原来的语音..我尝试使用sdcard保存TTS引擎语音使用synthesizetofile(),它工作fine..But我的要求是暂停,恢复TTS引擎语音没有存储到sd card...Please给我任何解决方案
发布于 2014-07-27 10:53:03
private void Teks_Ke_Suara_Kontak() {
String text = textkontakAuto.getText().toString();
HashMap<String, String> myHash = new HashMap<String, String>();
myHash.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "done");
String[] splitspeech = text.split(" : ");
for (int i = 0; i < splitspeech.length; i++)
{
if (i == 0)
{ // Use for the first splited text to flush on audio stream
SuaraKeTeks.speak(splitspeech[i].toString().trim(),TextToSpeech.QUEUE_FLUSH, myHash);
}
else
{ // add the new test on previous then play the TTS
SuaraKeTeks.speak(splitspeech[i].toString().trim(), TextToSpeech.QUEUE_ADD,myHash);
}
SuaraKeTeks.playSilence(750, TextToSpeech.QUEUE_ADD, null);
}
}
https://stackoverflow.com/questions/11664440
复制相似问题