Code example for TextToSpeech

Methods: addSpeech, speak, synthesizeToFile

0
          .getAbsolutePath().toLowerCase() + "/" + txt + ".wav";
          /* µ¹¤©¤@­ÓID¥i¦bonUtteranceCompleted¨ú±o */ 
          myHash.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,
              txt);
          /* Àx¦sÀÉ®× */ 
          tts.synthesizeToFile(txt, myHash, fileName);
          tts.addSpeech(txt, fileName);
          /* ¶Ç¤J­n»¡ªº¦r¦ê */ 
          tts.speak(txt, TextToSpeech.QUEUE_ADD,
              myHash);
        } else 
        { 
          tts.speak("Nothing to say", TextToSpeech.QUEUE_FLUSH, null);
        } 
      } 
    }); 
 
  } 
 
  final class runJavaScript 
  {