{"action":"created","issue":{"url":"https://api.github.com/repos/Uberi/speech_recognition/issues/398","repository_url":"https://api.github.com/repos/Uberi/speech_recognition","labels_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/398/labels{/name}","comments_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/398/comments","events_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/398/events","html_url":"https://github.com/Uberi/speech_recognition/issues/398","id":393852249,"node_id":"MDU6SXNzdWUzOTM4NTIyNDk=","number":398,"title":"Script stuck on hotword detection","user":{"login":"furqanahmedmtbc","id":45226315,"node_id":"MDQ6VXNlcjQ1MjI2MzE1","avatar_url":"https://avatars1.githubusercontent.com/u/45226315?v=4","gravatar_id":"","url":"https://api.github.com/users/furqanahmedmtbc","html_url":"https://github.com/furqanahmedmtbc","followers_url":"https://api.github.com/users/furqanahmedmtbc/followers","following_url":"https://api.github.com/users/furqanahmedmtbc/following{/other_user}","gists_url":"https://api.github.com/users/furqanahmedmtbc/gists{/gist_id}","starred_url":"https://api.github.com/users/furqanahmedmtbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furqanahmedmtbc/subscriptions","organizations_url":"https://api.github.com/users/furqanahmedmtbc/orgs","repos_url":"https://api.github.com/users/furqanahmedmtbc/repos","events_url":"https://api.github.com/users/furqanahmedmtbc/events{/privacy}","received_events_url":"https://api.github.com/users/furqanahmedmtbc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-24T10:17:12Z","updated_at":"2018-12-26T07:54:04Z","closed_at":null,"author_association":"NONE","body":"Steps to reproduce\r\n------------------\r\n\r\nI try to run the following script but it seems it is stuck on wake-word detection. I have spoken multiple times but the script does not seem to recognize the wake-word.\r\n(Note: The recognition works fine without the wake-word part, It just seems like the addition of wakeword requirement is not working.) \r\n\r\nI'm using the Google cloud Speech API on a Raspberry Pi 3.\r\n\r\nCode:\r\n```\r\npmdl = ['/home/pi/AoD_Final/V4/Squeak.pmdl']\r\nsbLoc = '/home/pi/AoD_Final/V4/'\r\nsbCfg = (sbLoc,pmdl)\r\n\r\nprint(sbCfg)\r\n\r\n# use the audio file as the audio source\r\nmic = sr.Microphone(device_index=3)\r\nr = sr.Recognizer()\r\n\r\n\r\nprint(\"A moment of silence, please...\")\r\nwith mic as source:\r\n    r.adjust_for_ambient_noise(source)\r\n    print(\"Set minimum energy threshold to {}\".format(r.energy_threshold))\r\n    \r\nwith mic as source:\r\n    r.adjust_for_ambient_noise(source)\r\n    #r.snowboy_wait_for_hot_word(source, \"/AoD_Final/V4\", \"Squeak.pmdl\", source, timeout=None)\r\n    audio = r.listen(source,snowboy_configuration=(\"/home/pi/AoD_Final/V4\",[\"/home/pi/AoD_Final/V4/Squeak.pmdl\"]))\r\n    #audio = r.listen(source,snowboy_configuration=sbCfg)\r\n    #audio = r.listen(source)\r\n```\r\n-------------------------Output-------------------------------------------------------------------\r\n```\r\nattempt to connect to server failed\r\nA moment of silence, please...\r\nSet minimum energy threshold to 817.50242197\r\n^CTraceback (most recent call last):\r\n  File \"with_listen.py\", line 31, in <module>\r\n    audio = r.listen(source,snowboy_configuration=(\"/home/pi/AoD_Final/V4\",[\"/home/pi/AoD_Final/V4/Squeak.pmdl\"]))\r\n  File \"/home/pi/.local/lib/python2.7/site-packages/speech_recognition/__init__.py\", line 638, in listen\r\n    buffer, delta_time = self.snowboy_wait_for_hot_word(snowboy_location, snowboy_hot_word_files, source, timeout)\r\n  File \"/home/pi/.local/lib/python2.7/site-packages/speech_recognition/__init__.py\", line 573, in snowboy_wait_for_hot_word\r\n    snowboy_result = detector.RunDetection(b\"\".join(resampled_frames))\r\n  File \"/home/pi/AoD_Final/V4/snowboydetect.py\", line 111, in RunDetection\r\n    return _snowboydetect.SnowboyDetect_RunDetection(self, *args)\r\nKeyboardInterrupt\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Uberi/speech_recognition/issues/comments/449923755","html_url":"https://github.com/Uberi/speech_recognition/issues/398#issuecomment-449923755","issue_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/398","id":449923755,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTkyMzc1NQ==","user":{"login":"furqanahmedmtbc","id":45226315,"node_id":"MDQ6VXNlcjQ1MjI2MzE1","avatar_url":"https://avatars1.githubusercontent.com/u/45226315?v=4","gravatar_id":"","url":"https://api.github.com/users/furqanahmedmtbc","html_url":"https://github.com/furqanahmedmtbc","followers_url":"https://api.github.com/users/furqanahmedmtbc/followers","following_url":"https://api.github.com/users/furqanahmedmtbc/following{/other_user}","gists_url":"https://api.github.com/users/furqanahmedmtbc/gists{/gist_id}","starred_url":"https://api.github.com/users/furqanahmedmtbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furqanahmedmtbc/subscriptions","organizations_url":"https://api.github.com/users/furqanahmedmtbc/orgs","repos_url":"https://api.github.com/users/furqanahmedmtbc/repos","events_url":"https://api.github.com/users/furqanahmedmtbc/events{/privacy}","received_events_url":"https://api.github.com/users/furqanahmedmtbc/received_events","type":"User","site_admin":false},"created_at":"2018-12-26T07:54:04Z","updated_at":"2018-12-26T07:54:04Z","author_association":"NONE","body":"I did some digging around. Looks like the scrip is stuck on \r\n`snowboy_result = detector.RunDetection(b\"\".join(resampled_frames))` \r\nin the speech recognition init file. \r\nThe \"_snowboy_result_\" value remains 0 even after speaking into the mic multiple times.\r\nThe hotword is supposed to be detected when this value goes above 0. Any idea how I can solve this issue?"}}
{"actor":{"display_login":"furqanahmedmtbc"}}