Android,连续语音识别和错误IO异常

时间:2013-08-28 11:52:20

标签: java android

我在连续VR方面遇到了麻烦。在我的代码中有一个实现VR的片段。

它有效但有时我看到它没有任何明显的理由它停止。没有错误,没有崩溃,我可以通过按两次按钮重新启动。

Log没有帮助,这就是我在LogCat上获得的

08-27 23:46:00.708 I/AudioService(433):  AudioFocus  requestAudioFocus() from android.media.AudioManager@422819d8com.google.android.voicesearch.audio.AudioRouterImpl$1@4229e1a8
08-27 23:46:00.755 I/VS.G3EngineManager(15890): create_rm: m=ENDPOINTER_DICTATION,l=en-US
08-27 23:46:00.770 I/VS.G3EngineManager(15890): Brought up new g3 instance :/system/usr/srec/en-US/endpointer_dictation.config for: en-USin: 13 ms
08-27 23:46:00.848 W/Sidekick_LocationOracleImpl(15890): Best location was null
08-27 23:46:00.856 W/Sidekick_LocationOracleImpl(15890): Best location was null
08-27 23:46:01.505 I/ActivityManager(433): Start proc com.devexpert.weather for broadcast com.devexpert.weather/.view.WidgetWeather2x1: pid=16138 uid=10071 gids={50071, 3003, 1015, 1028}
08-27 23:46:01.911 W/RecognitionDispatcher(15890): Could not stop engine 3
08-27 23:46:06.356 I/MicrophoneInputStream(15890): mic_close
08-27 23:46:06.388 I/AudioService(433):  AudioFocus  abandonAudioFocus() from android.media.AudioManager@422819d8com.google.android.voicesearch.audio.AudioRouterImpl$1@4229e1a8 
08-27 23:46:06.411 I/decoder (15890): INFO: recognition time wall: 5.61636 sec user: 1.49219 sec sys: 0.234375 sec 
08-27 23:46:06.544 I/GoogleRecognitionServiceImpl(15890): #startListening [it-IT]
08-27 23:46:06.552 I/AudioService(433):  AudioFocus  requestAudioFocus() from android.media.AudioManager@422819d8com.google.android.voicesearch.audio.AudioRouterImpl$1@4229e1a8
08-27 23:46:06.552 I/VS.G3EngineManager(15890): create_rm: m=ENDPOINTER_DICTATION,l=en-US
08-27 23:46:06.575 I/VS.G3EngineManager(15890): Brought up new g3 instance :/system/usr/srec/en-US/endpointer_dictation.config for: en-USin: 25 ms
08-27 23:46:06.598 W/Sidekick_LocationOracleImpl(15890): Best location was null
08-27 23:46:06.606 W/Sidekick_LocationOracleImpl(15890): Best location was null
08-27 23:46:07.661 W/RecognitionDispatcher(15890): Could not stop engine 3
08-27 23:46:11.231 I/MicrophoneInputStream(15890): mic_close
08-27 23:46:11.263 I/AudioService(433):  AudioFocus  abandonAudioFocus() from android.media.AudioManager@422819d8com.google.android.voicesearch.audio.AudioRouterImpl$1@4229e1a8
08-27 23:46:11.278 I/decoder (15890): INFO: recognition time wall: 4.67749 sec user: 1.21875 sec sys: 0.21875 sec 
08-27 23:46:11.395 I/GoogleRecognitionServiceImpl(15890): #startListening [it-IT]
08-27 23:46:11.411 I/AudioService(433):  AudioFocus  requestAudioFocus() from android.media.AudioManager@422819d8com.google.android.voicesearch.audio.AudioRouterImpl$1@4229e1a8
08-27 23:46:11.419 I/VS.G3EngineManager(15890): create_rm: m=ENDPOINTER_DICTATION,l=en-US
08-27 23:46:11.450 I/VS.G3EngineManager(15890): Brought up new g3 instance :/system/usr/srec/en-US/endpointer_dictation.config for: en-USin: 28 ms
08-27 23:46:11.450 W/Search.ConcurrentUtils(15890): Executor queue length is now 2. Perhaps some tasks are too long, or the pool is too small. [GrecoExecutor-1]
08-27 23:46:11.450 I/AudioService(433):  AudioFocus  abandonAudioFocus() from android.media.AudioManager@422819d8com.google.android.voicesearch.audio.AudioRouterImpl$1@4229e1a8
08-27 23:46:11.458 W/Sidekick_LocationOracleImpl(15890): Best location was null
08-27 23:46:11.458 W/Sidekick_LocationOracleImpl(15890): Best location was null
08-27 23:46:11.489 W/PairHttpConnection(15890): [Upload] Connection error
08-27 23:46:11.489 W/PairHttpConnection(15890): java.io.IOException: Timed out / error during connect
08-27 23:46:11.489 W/PairHttpConnection(15890):     at com.google.android.speech.network.PairHttpConnection.connect(PairHttpConnection.java:135)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at com.google.android.speech.network.NetworkRecognitionRunner.runNetworkLoop(NetworkRecognitionRunner.java:219)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at com.google.android.speech.network.NetworkRecognitionRunner.access$000(NetworkRecognitionRunner.java:54)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at com.google.android.speech.network.NetworkRecognitionRunner$1.run(NetworkRecognitionRunner.java:73)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
 08-27 23:46:11.489 W/PairHttpConnection(15890):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
08-27 23:46:11.489 W/PairHttpConnection(15890):     at com.google.android.searchcommon.util.ConcurrentUtils$1$1.run(ConcurrentUtils.java:90)

如您所见,VR有3个开始,由于IOEXCEPTION而停止的最后一个周期

我们从这个github https://github.com/fcrisciani/android-speech-recognition/tree/master/VoiceRecognition/src/com/speech/fcrisciani/voicerecognition

获得了源代码

1 个答案:

答案 0 :(得分:0)

你可能在这里处理一些错误。你需要捕获的第一个是outstanding on the AOSP bug tracker for nearly a year

我也发布了Google Product Forum about it here,但没有回复。如果您正在阅读本文并希望解决这些问题,请在AOSP问题上加注星标,并在产品论坛帖子上发表评论,以便注意到它!

要解决此问题,您需要实施such as the one demonstrated here

您的特定错误已发布在AOSP bug tracker here上,但与谷歌语音搜索一样关闭。有人发布了regarding the bug on the Product Forum here,但由于不活动而关闭了。

这是一个笑话,你不能让谷歌对这些事情做任何事情。我想继续咆哮,但最好不要......