2

I am using TTS engine for converting text to speech and i want to pause TTS voice and resume back voice..I tried to using sdcard for save TTS engine voice using synthesizetofile() and it works fine..But my requirement is to pause,resume TTS engine voice without stored into sd card...Please give me any solution

4

1 回答 1

0
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);

     }
}
于 2014-07-27T02:53:02.823 回答