VR連続で困っています。私のコードには、VR を実装するフラグメントがあります。
それは機能しますが、明らかな理由もなく停止することがあるのを見ました。エラーもクラッシュもありません。ボタンを 2 回タップするだけで再起動できます。
ログは役に立ちません。これは 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