我使用SpeechRecognizer实现了连续语音识别器。 在onBeginningOfSpeech之后,RecognitionListener通常会转到ERROR_NETWORK(错误号2)。 这不是每次都发生,而是多次发生。 此行为自上次更新Google 4.1.24.1672412.arm更新(2015年1月12日)
后开始protected class SpeechRecognitionListener implements RecognitionListener
{
public void onBeginningOfSpeech()
{
}
public void onError(int error)
{
if (mIsStreamSolo)
{ // CAudioLibrary.unmute();
mIsStreamSolo = false;
}
if(error == SpeechRecognizer.ERROR_NETWORK||error == SpeechRecognizer.ERROR_SERVER)
{
.....
我检查过logcat,发现它出现了很多这样的错误: 它不是我的设备特定,它也在我的用户设备上给出了相同的错误。谷歌网站上有问题吗?如果我还原谷歌更新,它可以正常工作而不会出现这些错误。 提前谢谢。
01-15 14:36:48.656 3012-3012/? D/STATUSBAR-NetworkController﹕
onDataActivity: direction=2 01-15 14:36:48.656 3012-3012/?
D/STATUSBAR-NetworkController﹕ refreshSignalCluster -
setNWBoosterIndicators(false) 01-15 14:36:48.656 3012-3012/?
D/STATUSBAR-NetworkController﹕ refreshSignalCluster: data=2 bt=false
01-15 14:36:48.691 32404-32409/? D/dalvikvm﹕ GC_CONCURRENT freed
384K, 25% free 10740K/14260K, paused 10ms+3ms, total 40ms 01-15
14:36:48.871 5732-13019/? W/JavaNetConnection﹕ Failed to get
connection status.
java.io.FileNotFoundException: https://www.google.com/m/voice-search/down?pair=6239918a-dc45-4eea-ac6f-b9bf8de57ced
at kxb.getInputStream(PG:228)
at kxa.getInputStream(PG:210)
at kxc.getInputStream(PG:25)
at cla.Gj(PG:256)
at dzz.Gj(PG:26)
at cla.Gi(PG:240)
at cla.disconnect(PG:132)
at clb.b(PG:110)
at clb.a(PG:66)
at dzb.a(PG:197)
at cqj.HS(PG:529)
at cqi.run(PG:314) 01-15 14:36:48.871 5732-13019/? W/S3NetworkUtils﹕ [Download] response code: 400, internal error
header: -74061 01-15 14:36:49.071 5732-13104/? W/JavaNetConnection﹕
Failed to get connection status.
java.io.FileNotFoundException: https://www.google.com/m/voice-search/down?pair=af1df3dc-08ac-45fd-bb30-eee3393bcb9c
at kxb.getInputStream(PG:228)
at kxa.getInputStream(PG:210)
at kxc.getInputStream(PG:25)
at cla.Gj(PG:256)
at dzz.Gj(PG:26)
at cla.Gi(PG:240)
at cla.disconnect(PG:132)
at clb.b(PG:110)
at clb.a(PG:66)
at dzb.a(PG:197)
at cqj.HS(PG:529)
at cqi.run(PG:314) 01-15 14:36:49.071 5732-13104/? W/S3NetworkUtils﹕ [Download] response code: 400, internal error
另外,我注意到以下几行:
01-15 14:36:55.556 5732-6800 /? W / EventLogger:recordGsaError eyd:tr-TR 在hdv.a(PG:121) at java.lang.reflect.Method.invokeNative(Native Method) 在java.lang.reflect.Method.invoke(Method.java:515) 在fid.run(PG:102) at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:422) 在java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:152) at java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587) 在java.lang.Thread.run(Thread.java:841)01-15 14:36:55.556 5732-6800 /? W / ErrorProcessor:onFatalError,忽略 引擎错误(1):eyd:tr-TR 01-15 14:36:55.556 5732-6800 /? W / EventLogger:recordGsaError eyb:GsaErrorCode:458756,引擎:1 在hdv.a(PG:126) at java.lang.reflect.Method.invokeNative(Native Method) 在java.lang.reflect.Method.invoke(Method.java:515) 在fid.run(PG:102) at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:422) 在java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:152) at java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587) 在java.lang.Thread.run(Thread.java:841)01-15 14:36:55.556 5732-6800 /? W / DefaultRecognitionState:重复错误 来自二级引擎。 01-15 14:36:55.556 5732-6800 /? W / ErrorProcessor:onFatalError,忽略引擎错误(1):eyb: GsaErrorCode:458756,引擎:1