Android版本2.3.6
我有一个语音计算器应用程序。用户说表达式,应用程序计算结果并显示结果。
但是最近,语音识别中断了,在logcat中,我收到以下错误......
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): Could not send the requests
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): java.io.IOException: bad response code: 404
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at com.google.android.voicesearch.masf.MasfSender.send(MasfSender.java:116)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at com.google.android.voicesearch.masf.MasfSender.send(MasfSender.java:62)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at com.google.android.voicesearch.masf.MasfSenderAsyncTask.doInBackground(MasfSenderAsyncTask.java:52)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at com.google.android.voicesearch.masf.MasfSenderAsyncTask.doInBackground(MasfSenderAsyncTask.java:30)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at android.os.AsyncTask$2.call(AsyncTask.java:185)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
12-22 14:55:28.729: E/MasfSenderAsyncTask(11023): at java.lang.Thread.run(Thread.java:1019)
我已经搜索了相关的问题并发现了类似的问题,其中说这是Google联系人同步的问题。这是link。我尝试了上面链接中给出的解决方案,但无法解决。
关于语音识别的另一个问题::据我所知,语音识别通过连接到谷歌服务器来工作,适用于Android版本< 4.0和4.0,识别工作离线。
现在,在onActivityResult
中,我得到了结果,但我仍然得到了例外。
[2次3次,2次3次,2次3次,3次,2次3次,2次理论,3次如何,2次理论,2次免费]
为什么我得到异常,即使在输入被识别之后?什么是尝试发送到谷歌服务器的应用程序?
我也在4.3 Nexus 7上测试过,我没有在logcat中得到异常,但是,我仍然无法使应用程序正常工作。它停在2.3.6
中应用程序停止的同一位置以下是4.3
中的logcat12-22 15:47:13.692: I/ActivityManager(505): START u0 {act=android.speech.action.RECOGNIZE_SPEECH cmp=com.google.android.googlequicksearchbox/com.google.android.voicesearch.intentapi.IntentApiActivity (has extras)} from pid 26900
12-22 15:47:13.802: D/dalvikvm(505): GC_FOR_ALLOC freed 578K, 30% free 28790K/41104K, paused 85ms, total 85ms
12-22 15:47:13.892: D/dalvikvm(505): GC_FOR_ALLOC freed 1115K, 32% free 28228K/41104K, paused 84ms, total 84ms
12-22 15:47:13.932: D/dalvikvm(13998): GC_FOR_ALLOC freed 1018K, 15% free 11678K/13660K, paused 27ms, total 28ms
12-22 15:47:13.942: W/IntentApiParams(13998): The audio format is not supported [requested=null supported=audio/AMR]
12-22 15:47:13.942: I/AudioService(505): AudioFocus requestAudioFocus() from android.media.AudioManager@41f3cc90com.google.android.voicesearch.audio.AudioRouterImpl$1@41ed4cf8
12-22 15:47:13.942: D/audio_hw_primary(180): adev_open_input_stream: enter
12-22 15:47:13.942: D/audio_hw_primary(180): adev_open_input_stream: exit
12-22 15:47:13.942: D/audio_hw_primary(180): in_standby: enter
12-22 15:47:13.942: D/audio_hw_primary(180): in_standby: exit: status(0)
12-22 15:47:13.942: D/audio_hw_primary(180): in_standby: enter
12-22 15:47:13.942: D/audio_hw_primary(180): in_standby: exit: status(0)
12-22 15:47:13.952: I/VS.G3EngineManager(13998): create_rm: m=ENDPOINTER_DICTATION,l=en-US
12-22 15:47:13.952: I/VS.G3EngineManager(13998): Brought up new g3 instance :/system/usr/srec/en-US/endpointer_dictation.config for: en-USin: 2 ms
12-22 15:47:13.952: D/audio_hw_primary(180): in_set_parameters: enter: kvpairs=input_source=6;routing=-2147483644
12-22 15:47:13.952: D/audio_hw_primary(180): in_set_parameters: exit: status(11)
12-22 15:47:13.962: D/audio_hw_primary(180): start_input_stream: enter: usecase(3)
12-22 15:47:13.962: D/audio_hw_primary(180): select_devices: out_snd_device(0: none) in_snd_device(34: voice-rec-mic)
12-22 15:47:13.962: D/audio_hw_primary(180): enable_snd_device: sending audio calibration for snd_device(34) acdb_id(62)
12-22 15:47:13.962: E/ACDB-LOADER(180): Error: ACDB AudProc vol returned = -8
12-22 15:47:13.962: D/audio_hw_primary(180): enable_snd_device: snd_device(34: voice-rec-mic)
12-22 15:47:13.962: D/audio_hw_primary(180): enable_audio_route: apply mixer path: audio-record
12-22 15:47:13.972: D/audio_hw_primary(180): start_input_stream: exit
12-22 15:47:13.982: W/Sidekick_LocationOracleImpl(13998): Best location was null
12-22 15:47:13.982: W/Sidekick_LocationOracleImpl(13998): Best location was null
12-22 15:47:14.002: D/dalvikvm(13998): GC_CONCURRENT freed 675K, 13% free 11939K/13660K, paused 6ms+3ms, total 44ms
12-22 15:47:14.002: D/dalvikvm(13998): WAIT_FOR_CONCURRENT_GC blocked 9ms
12-22 15:47:14.022: I/ActivityManager(505): Displayed com.google.android.googlequicksearchbox/com.google.android.voicesearch.intentapi.IntentApiActivity: +126ms
12-22 15:47:15.123: W/RecognitionDispatcher(13998): Could not stop engine 3
12-22 15:47:16.585: I/MicrophoneInputStream(13998): mic_close
12-22 15:47:16.595: D/audio_hw_primary(180): in_standby: enter
12-22 15:47:16.625: D/audio_hw_primary(180): stop_input_stream: enter: usecase(3: audio-record)
12-22 15:47:16.625: D/audio_hw_primary(180): disable_audio_route: reset mixer path: audio-record
12-22 15:47:16.625: D/audio_hw_primary(180): disable_snd_device: snd_device(34: voice-rec-mic)
12-22 15:47:16.625: D/audio_hw_primary(180): stop_input_stream: exit: status(0)
12-22 15:47:16.625: D/audio_hw_primary(180): in_standby: exit: status(0)
12-22 15:47:16.635: D/audio_hw_primary(180): adev_close_input_stream
12-22 15:47:16.635: D/audio_hw_primary(180): in_standby: enter
12-22 15:47:16.635: D/audio_hw_primary(180): in_standby: exit: status(0)
12-22 15:47:16.645: I/AudioService(505): AudioFocus abandonAudioFocus() from android.media.AudioManager@41f3cc90com.google.android.voicesearch.audio.AudioRouterImpl$1@41ed4cf8
12-22 15:47:16.645: D/dalvikvm(13998): threadid=42: thread exiting, not yet detached (count=0)
12-22 15:47:16.645: I/decoder(13998): INFO: recognition time wall: 2.68082 sec user: 0.75 sec sys: 0 sec
12-22 15:47:17.095: D/dalvikvm(505): GC_FOR_ALLOC freed 582K, 30% free 28794K/41104K, paused 101ms, total 102ms
12-22 15:47:17.185: D/dalvikvm(505): GC_FOR_ALLOC freed 1115K, 32% free 28231K/41104K, paused 87ms, total 87ms
12-22 15:47:17.235: D/AVCP(26900): ***** Voice Input *****
12-22 15:47:17.235: D/AVCP(26900): [2 times 3, two times 3, two times three, to times 3, 2 times three]
12-22 15:47:17.235: D/AVCP(26900): Voice Constructor
12-22 15:47:17.235: D/AVCP(26900): analyzeVoiceInput
12-22 15:47:17.235: D/AVCP(26900): VoiceInput Size = 5
12-22 15:47:17.235: D/AVCP(26900): 0.1
12-22 15:47:20.368: D/dalvikvm(29923): GC_CONCURRENT freed 541K, 6% free 10523K/11148K, paused 5ms+2ms, total 38ms
12-22 15:47:21.099: D/audio_hw_primary(180): out_standby: enter: usecase(1: low-latency-playback)
12-22 15:47:21.149: D/audio_hw_primary(180): stop_output_stream: enter: usecase(1: low-latency-playback)
12-22 15:47:21.149: D/audio_hw_primary(180): disable_audio_route: reset mixer path: low-latency-playback
12-22 15:47:21.149: D/audio_hw_primary(180): disable_snd_device: snd_device(2: speaker)
12-22 15:47:21.159: D/audio_hw_primary(180): stop_output_stream: exit: status(0)
12-22 15:47:21.159: D/audio_hw_primary(180): out_standby: exit
如果您还有其他需要,请告诉我..谢谢..