我正在使用Pocketsphinx4Android(Android Studio版本)构建一个示例项目。
我正在使用自己的语言模型,我有很好的结果,但如果它在一段时间内没有收到"语音输入",它就会完全停止我的ui。
有人知道pocketsphinx是否有自动睡眠模式吗?
我的应用程序没有完全崩溃,只有ui被阻塞(有时>1分钟),在这个延迟之后,调试点也被击中,我可以继续。
谢谢。
更新:logcat输出。
//应用程序启动时输出,关键字识别良好(21:53MEZ)
04-02 21:53:17.610 11737-12074/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 0 words
04-02 21:53:17.620 11737-11737/rb.gui.cmusphinx_proto I/SpeechRecognizer﹕ Stop recognition
04-02 21:53:17.620 11737-11737/rb.gui.cmusphinx_proto E/cmusphinx﹕ ERROR: "ngram_search.c", line 1141: Couldn't find <s> in first frame
04-02 21:53:17.620 11737-11737/rb.gui.cmusphinx_proto I/SpeechRecognizer﹕ Start recognition "wakeup"
04-02 21:53:17.630 151-4838/? I/audio_policy_mrvl﹕ get_device_for_input_source: Input source 6, device 80000004
04-02 21:53:17.630 151-4838/? I/wrap_samsungREC﹕ [wrap_samsungREC] CreateSamsungREC init
04-02 21:53:17.630 151-4838/? I/samsungRecord﹕ [samsungrecord] SamsungRecInit
04-02 21:53:17.640 151-4838/? I/samsungRecord﹕ [samsungrecordMIC]Use HardCoding Values
04-02 21:53:17.640 151-4838/? I/samsungRecord﹕ 1
04-02 21:53:17.640 151-4838/? I/audio_hw_mrvl﹕ mrvl_hw_dev_open_input_stream: in->device 80000000, in->sample_rate 44100
04-02 21:53:17.670 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: pocketsphinx.c(863): Writing raw audio log file: /storage/emulated/0/Android/data/rb.gui.cmusphinx_proto/files/sync/000000006.raw
04-02 21:53:17.670 151-4838/? I/audio_policy_mrvl﹕ mrvl_ap_dev_start_input: input 760
04-02 21:53:17.670 151-352/? I/AudioSystem﹕ AudioSystem::setParameters(STREAM_IN_ACTIVE=1;routing=-2147483644;voice_recognition=on)
04-02 21:53:17.680 151-12078/? I/audio_hw_mrvl﹕ stream_in_set: buffer_time_max is 116100, buffer_time_min is 11609, requested is 100000
04-02 21:53:17.680 151-12078/? I/audio_hw_mrvl﹕ stream_in_set: period time eventually set as 20000 usec
04-02 21:53:17.680 151-12078/? I/audio_hw_mrvl﹕ stream_in_set: buffer time eventually set as 100000 usec
04-02 21:53:17.680 151-12078/? I/audio_hw_mrvl﹕ stream_in_set: bufferSize is 4410, periodSize is 882
04-02 21:53:17.680 151-12078/? I/MarvellAmixer﹕ get_amixer_value, device 80000004, left volume 125, right volume 125, codec info 0, mic mode 2
04-02 21:53:17.680 151-12078/? I/AudioHIFIPath﹕ default_enable: Enable hifi input device earpiece
04-02 21:53:17.680 151-12078/? I/acm_aph﹕ ACM_APHPathHandling: path=HiFiRecognitionRecordFromMic2 operation=ENABLE ref_path=(null) amixer value=0x20460064
04-02 21:53:17.680 151-12078/? I/acm_aph﹕ ACM_APHPathHandling: Current active path count=1
04-02 21:53:17.680 151-12078/? I/acm_ach_elba﹕ Elba_Enable: enable elba component
04-02 21:53:19.182 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(99): cmn_prior_update: from <
04-02 21:53:19.182 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 31.92
04-02 21:53:19.182 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -10.33
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 3.02
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.70
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -2.30
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -4.98
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.76
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.06
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.17
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.81
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.52
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.09
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.95
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(116): cmn_prior_update: to <
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 31.70
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -10.55
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 2.65
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -4.03
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -2.45
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -4.64
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.99
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.43
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.21
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.78
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.61
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.05
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.72
04-02 21:53:19.192 11737-12077/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
我在一片寂静中离开了设备半个小时后,我再次进行了关键词测试。
//KEYWORD SPOKEN
04-02 22:32:31.897 151-384/? I/audio_policy_mrvl﹕ mrvl_ap_dev_stop_input: input 827
04-02 22:32:31.897 151-352/? I/AudioSystem﹕ AudioSystem::setParameters(STREAM_IN_ACTIVE=0;routing=-2147483648;voice_recognition=off)
04-02 22:32:31.907 151-12274/? I/MarvellAmixer﹕ get_amixer_value, device 80000004, left volume 0, right volume 0, codec info 0, mic mode 2
04-02 22:32:31.907 151-12274/? I/AudioHIFIPath﹕ default_disable: Disable hifi input device earpiece
04-02 22:32:31.907 151-12274/? I/acm_aph﹕ ACM_APHPathHandling: path=HiFiRecognitionRecordFromMic2 operation=DISABLE ref_path=(null) amixer value=0x0
04-02 22:32:31.907 151-12274/? I/acm_aph﹕ ACM_APHPathHandling: Current active path count=0
04-02 22:32:31.917 151-12274/? I/acm_ach_elba﹕ Elba_Disable: disable elba component
04-02 22:32:31.927 151-4838/? I/audio_policy_mrvl﹕ mrvl_ap_dev_release_input: 827
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(131): cmn_prior_update: from <
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 39.57
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -17.53
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 7.55
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -10.15
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 2.16
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -2.96
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.95
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.43
04-02 22:32:31.937 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -4.66
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.50
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.83
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.72
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -2.44
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(149): cmn_prior_update: to <
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 39.70
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -14.30
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 8.83
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -8.17
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 2.15
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.39
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.90
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.78
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -4.60
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.54
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.44
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.31
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.37
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdtree.c(1550): 36062 words recognized (8/fr)
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdtree.c(1552): 703409 senones evaluated (157/fr)
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdtree.c(1556): 261258 channels searched (58/fr), 66750 1st, 62417 last
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdtree.c(1559): 36860 words for which last channels evaluated (8/fr)
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdtree.c(1561): 13937 candidate words for entering last phone (3/fr)
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdtree.c(1564): fwdtree 25.92 CPU 0.580 xRT
04-02 22:32:31.947 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdtree.c(1567): fwdtree 232.21 wall 5.194 xRT
04-02 22:32:31.977 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 6 words
04-02 22:32:32.848 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(938): 30958 words recognized (7/fr)
04-02 22:32:32.848 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(940): 166036 senones evaluated (37/fr)
04-02 22:32:32.848 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(942): 60973 channels searched (13/fr)
04-02 22:32:32.848 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(944): 32515 words searched (7/fr)
04-02 22:32:32.848 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(947): 696 word transitions (0/fr)
04-02 22:32:32.848 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(950): fwdflat 0.90 CPU 0.020 xRT
04-02 22:32:32.848 11737-12273/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search_fwdflat.c(953): fwdflat 0.90 wall 0.020 xRT
04-02 22:32:32.848 11737-11737/rb.gui.cmusphinx_proto I/SpeechRecognizer﹕ Stop recognition
04-02 22:32:33.499 579-871/? E/Watchdog﹕ !@Sync 1004
//APP UI IS BLOCKED NOW, I JUST GET TOUCH EVENTS
04-02 22:32:37.322 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.272 ] when=30139388519000
04-02 22:32:37.322 579-704/? I/InputDispatcher﹕ Delivering touch to: action: 0x0, toolType: 1
04-02 22:32:37.432 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30139498107000
04-02 22:32:37.432 579-704/? I/InputDispatcher﹕ Delivering touch to: action: 0x1, toolType: 1
04-02 22:32:38.033 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.273 ] when=30140093078000
04-02 22:32:38.173 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search.c(1199): </s> not found in last frame, using OPEN.4469 instead
04-02 22:32:38.173 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search.c(1252): lattice start node <s>.0 end node OPEN.4423
04-02 22:32:38.173 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search.c(1278): Eliminated 93 nodes before end node
04-02 22:32:38.183 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30140247589000
04-02 22:32:38.684 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.274 ] when=30140749023000
04-02 22:32:38.814 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30140872863000
04-02 22:32:39.354 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.275 ] when=30141412261000
04-02 22:32:39.484 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30141543762000
04-02 22:32:39.705 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.276 ] when=30141769012000
04-02 22:32:39.845 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30141900268000
04-02 22:32:39.995 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.277 ] when=30142051971000
04-02 22:32:40.095 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30142150177000
04-02 22:32:40.195 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.278 ] when=30142259216000
04-02 22:32:40.275 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30142332763000
04-02 22:32:40.395 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.279 ] when=30142452972000
04-02 22:32:40.475 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30142535034000
04-02 22:32:42.117 579-705/? I/InputReader﹕ Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.280 ] when=30144175903000
04-02 22:32:42.237 579-705/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=30144297454000
04-02 22:32:49.494 1696-1696/? I/wpa_supplicant﹕ wlan0: Setting scan request: 0 sec 0 usec
04-02 22:32:49.494 1696-1696/? I/wpa_supplicant﹕ Scan requested (ret=0) - scan timeout 30 seconds
04-02 22:32:53.008 1696-1696/? I/wpa_supplicant﹕ nl80211: Received scan results (5 BSSes)
04-02 22:32:58.052 579-704/? I/InputDispatcher﹕ Application is not responding. It has been 20017.2ms since event, 20016.6ms since wait started. Reason: Waiting because the touched window has not finished processing the input events that were previously delivered to it.
04-02 22:32:58.052 579-704/? I/WindowManager﹕ Input event dispatching timed out sending to rb.gui.cmusphinx_proto/rb.gui.cmusphinx_proto.RBGUIAndroidActivity. Reason: Waiting because the touched window has not finished processing the input events that were previously delivered to it.
04-02 22:33:03.498 579-871/? E/Watchdog﹕ !@Sync 1005
04-02 22:33:03.508 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:03.508 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.053 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search.c(1383): Lattice has 19204 nodes, 127512 links
04-02 22:33:09.414 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ps_lattice.c(1368): Normalizer P(O) = alpha(OPEN:4423:4469) = -27073656
04-02 22:33:09.534 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ps_lattice.c(1403): Joint P(O,S) = -27073732 P(S|O) = -76
04-02 22:33:09.534 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search.c(874): bestpath 36.40 CPU 0.814 xRT
04-02 22:33:09.534 11737-11737/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: ngram_search.c(877): bestpath 36.69 wall 0.821 xRT
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Window spent 32207.7ms processing the last input event:
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Window spent 32172.4ms processing the last input event:
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Window spent 32160.8ms processing the last input event:
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Window spent 32148.7ms processing the last input event:
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Window spent 32136.5ms processing the last input event:
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Window spent 32124.5ms processing the last input event:
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Window spent 32112.2ms processing the last input event:
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.534 579-704/? I/InputDispatcher﹕ Dropped event because it is stale.
04-02 22:33:09.544 579-704/? I/InputDispatcher﹕ Window spent 32102.4ms
//keyword is recognized now (i have a textview for that in my view) and UI isn't
//blocking anymore.
processing the last input event:
04-02 22:33:09.544 11737-11737/rb.gui.cmusphinx_proto I/SpeechRecognizer﹕ Start recognition "wakeup"
04-02 22:33:09.544 151-384/? I/audio_policy_mrvl﹕ get_device_for_input_source: Input source 6, device 80000004
04-02 22:33:09.544 151-384/? I/wrap_samsungREC﹕ [wrap_samsungREC] CreateSamsungREC init
04-02 22:33:09.544 151-384/? I/samsungRecord﹕ [samsungrecord] SamsungRecInit
04-02 22:33:09.544 151-384/? I/samsungRecord﹕ [samsungrecordMIC]Use HardCoding Values
04-02 22:33:09.544 151-384/? I/samsungRecord﹕ 1
04-02 22:33:09.544 151-384/? I/audio_hw_mrvl﹕ mrvl_hw_dev_open_input_stream: in->device 80000000, in->sample_rate 44100
04-02 22:33:09.574 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: pocketsphinx.c(863): Writing raw audio log file: /storage/emulated/0/Android/data/rb.gui.cmusphinx_proto/files/sync/000000039.raw
04-02 22:33:09.574 151-384/? I/audio_policy_mrvl﹕ mrvl_ap_dev_start_input: input 829
04-02 22:33:09.574 151-352/? I/AudioSystem﹕ AudioSystem::setParameters(STREAM_IN_ACTIVE=1;routing=-2147483644;voice_recognition=on)
04-02 22:33:09.584 151-12288/? I/audio_hw_mrvl﹕ stream_in_set: buffer_time_max is 116100, buffer_time_min is 11609, requested is 100000
04-02 22:33:09.584 151-12288/? I/audio_hw_mrvl﹕ stream_in_set: period time eventually set as 20000 usec
04-02 22:33:09.584 151-12288/? I/audio_hw_mrvl﹕ stream_in_set: buffer time eventually set as 100000 usec
04-02 22:33:09.584 151-12288/? I/audio_hw_mrvl﹕ stream_in_set: bufferSize is 4410, periodSize is 882
04-02 22:33:09.584 151-12288/? I/MarvellAmixer﹕ get_amixer_value, device 80000004, left volume 125, right volume 125, codec info 0, mic mode 2
04-02 22:33:09.584 151-12288/? I/AudioHIFIPath﹕ default_enable: Enable hifi input device earpiece
04-02 22:33:09.584 151-12288/? I/acm_aph﹕ ACM_APHPathHandling: path=HiFiRecognitionRecordFromMic2 operation=ENABLE ref_path=(null) amixer value=0x20460064
04-02 22:33:09.584 151-12288/? I/acm_aph﹕ ACM_APHPathHandling: Current active path count=1
04-02 22:33:09.584 151-12288/? I/acm_ach_elba﹕ Elba_Enable: enable elba component
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(99): cmn_prior_update: from <
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 39.70
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -14.30
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 8.83
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -8.17
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 2.15
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.39
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.90
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.78
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -4.60
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.54
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.44
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.31
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.37
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(116): cmn_prior_update: to <
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 38.87
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -14.02
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 8.64
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -8.52
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 1.71
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.70
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.93
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.50
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.72
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 1.22
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.26
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.64
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.02
04-02 22:33:11.546 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(99): cmn_prior_update: from <
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 38.87
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -14.02
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 8.64
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -8.52
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 1.71
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.70
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.93
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -0.50
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.72
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 1.22
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.26
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.64
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.02
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ INFO: cmn_prior.c(116): cmn_prior_update: to <
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 38.05
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -15.01
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 7.49
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -9.09
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 1.16
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -4.37
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.37
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 0.04
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -3.12
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 1.75
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.26
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ 1.58
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ -1.69
04-02 22:33:14.549 11737-12287/rb.gui.cmusphinx_proto I/cmusphinx﹕ >
从日志来看,您的问题是您试图同时解码太大的话语。解码需要时间并且会阻塞UI。
为了持续收听,pocketsphinx在演示中演示了关键字激活模式。不建议使用语言模型模式进行连续解码,不应该这样工作。您可以使用关键字发现模式连续收听,并切换到针对单个请求的语言模型。
如果您仍然喜欢用于连续转录的语言模型,请确保使用更窄的波束来更快地解码,并且在onEndOfSpeech
回调中的每个静音时都要完成发音。
我对PocketSphinx不是特别熟悉,但不得不对其他语音识别系统做相反的事情。不管它是否是原生实现的,都可以相对简单地使用倒计时计时器和监听器来添加它。
OnSpeechEnd(可能通过SpeechEndSignal检测到http://cmusphinx.sourceforge.net/doc/sphinx4/edu/cmu/sphinx/frontend/endpoint/SpeechEndSignal.html)我们开始倒计时(http://developer.android.com/reference/android/os/CountDownTimer.html)在onFinish()中使用speechRecognizer.stop()。当我们听到语音时,我们会取消计时器,但由于计时器与SpeechEndSignal相连,下次我们停止通话时,计时器将重新启动。唯一的补充步骤是添加一个GUI元素来重新启动语音识别器,因为它将在此时停止。
希望这能有所帮助。