{"action":"created","issue":{"url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/370","repository_url":"https://api.github.com/repos/Kitt-AI/snowboy","labels_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/370/labels{/name}","comments_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/370/comments","events_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/370/events","html_url":"https://github.com/Kitt-AI/snowboy/issues/370","id":297803725,"number":370,"title":"runing demo_arecord.py error on RPi","user":{"login":"michalkravcik","id":32197723,"avatar_url":"https://avatars0.githubusercontent.com/u/32197723?v=4","gravatar_id":"","url":"https://api.github.com/users/michalkravcik","html_url":"https://github.com/michalkravcik","followers_url":"https://api.github.com/users/michalkravcik/followers","following_url":"https://api.github.com/users/michalkravcik/following{/other_user}","gists_url":"https://api.github.com/users/michalkravcik/gists{/gist_id}","starred_url":"https://api.github.com/users/michalkravcik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalkravcik/subscriptions","organizations_url":"https://api.github.com/users/michalkravcik/orgs","repos_url":"https://api.github.com/users/michalkravcik/repos","events_url":"https://api.github.com/users/michalkravcik/events{/privacy}","received_events_url":"https://api.github.com/users/michalkravcik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-16T14:32:08Z","updated_at":"2018-02-21T20:03:07Z","closed_at":null,"author_association":"NONE","body":"Hi everybody,\r\n\r\ni would like to ask for any advice how to fix a issue with Snowboy on Raspberry pi Zero, with I2S microphone (SPH0645). Microphone works well with arecord command. So I use a demo_arecord.py, but I can't go through this errors\r\n\r\n``^Cpi@pi:~/snowboy/snowboy/examples/Python $ sudo python demo_arecord.py snowboy.umdl \r\nListening... Press Ctrl+C to exit\r\nException in thread Thread-1:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/threading.py\", line 801, in __bootstrap_inner\r\n    self.run()\r\n  File \"/usr/lib/python2.7/threading.py\", line 754, in run\r\n    self.__target(*self.__args, **self.__kwargs)\r\n  File \"/home/pi/snowboy/snowboy/examples/Python/snowboydecoder_arecord.py\", line 99, in record_proc\r\n    wav = wave.open(process.stdout, 'rb')\r\n  File \"/usr/lib/python2.7/wave.py\", line 511, in open\r\n    return Wave_read(f)\r\n  File \"/usr/lib/python2.7/wave.py\", line 164, in __init__\r\n    self.initfp(f)\r\n  File \"/usr/lib/python2.7/wave.py\", line 129, in initfp\r\n    self._file = Chunk(file, bigendian = 0)\r\n  File \"/usr/lib/python2.7/chunk.py\", line 63, in __init__\r\n    raise EOFError\r\nEOFError\r\n``\r\n\r\nDo have anybody idea how to fix it?\r\nI already try it with my pmdl from snowboy website.\r\nSwig/Python already completed.\r\nthank you."},"comment":{"url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/comments/367452925","html_url":"https://github.com/Kitt-AI/snowboy/issues/370#issuecomment-367452925","issue_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/370","id":367452925,"user":{"login":"chenguoguo","id":11788179,"avatar_url":"https://avatars2.githubusercontent.com/u/11788179?v=4","gravatar_id":"","url":"https://api.github.com/users/chenguoguo","html_url":"https://github.com/chenguoguo","followers_url":"https://api.github.com/users/chenguoguo/followers","following_url":"https://api.github.com/users/chenguoguo/following{/other_user}","gists_url":"https://api.github.com/users/chenguoguo/gists{/gist_id}","starred_url":"https://api.github.com/users/chenguoguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenguoguo/subscriptions","organizations_url":"https://api.github.com/users/chenguoguo/orgs","repos_url":"https://api.github.com/users/chenguoguo/repos","events_url":"https://api.github.com/users/chenguoguo/events{/privacy}","received_events_url":"https://api.github.com/users/chenguoguo/received_events","type":"User","site_admin":false},"created_at":"2018-02-21T20:03:07Z","updated_at":"2018-02-21T20:03:07Z","author_association":"COLLABORATOR","body":"There isn't really \"steps\" that we should follow other than http://docs.kitt.ai/snowboy/#set-up-audio.\r\n\r\nsnowboydecoder_arecord.py basically takes audio from arecord and sends it to Snowboy for detection. So as long as arecord can properly capture audio from your device, it should just work. That's why I was asking you to try out those arecord commands.\r\n\r\nBy looking at the error below\r\n```\r\nline 99, in record_proc wav = wave.open(process.stdout, 'rb') File \r\n```\r\nit seems to me that there might be something wrong with `process.stdout`, which relates to the arecord command.\r\n\r\nThe original command (https://github.com/Kitt-AI/snowboy/blob/master/examples/Python/snowboydecoder_arecord.py#L95) used in snowboydecoder_arecord.py is\r\n\r\n```\r\ncmd = 'arecord -q -r %d -f S16_LE' % RECORD_RATE\r\n```\r\n\r\nThe required audio format is S16_LE. I searched the error on Google, and you may be able to fix that by following (which is similar to our audio setup step in the documentation): https://stackoverflow.com/questions/36208176/arecord-set-params1233-sample-format-non-available-available-formats-s16-l\r\n\r\nYou can also try other microphones."}}
{"actor":{"display_login":"chenguoguo"}}