-3
我試圖創建一個語音識別應用程序,其中應用程序接收語音和發送的東西。我想要調用onEndOfSpeech方法等待一秒鐘,然後再重新執行整個語音識別意圖。在Java中使用延遲
public void onEndOfSpeech() {
Log.d("Speech", "onEndOfSpeech");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
mSpeechRecognizer.startListening(mSpeechRecognizerIntent);
}
不確定我是否正確地做到了這一點。 謝謝!
了Thread.sleep(3000);不好。使用處理程序。 – Raghunandan 2013-05-03 05:36:39
最好從現在開始計劃3000毫秒發生,而不是將整個程序凍結3000毫秒。 – Patashu 2013-05-03 05:42:44
我想做那個Patashu,我怎麼做到的? – 2013-05-03 05:49:25