{"action":"created","issue":{"url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/12","repository_url":"https://api.github.com/repos/Kitt-AI/snowboy","labels_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/12/comments","events_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/12/events","html_url":"https://github.com/Kitt-AI/snowboy/issues/12","id":157788715,"number":12,"title":"Call start() again after terminate()","user":{"login":"kgorszczyk","id":15107518,"avatar_url":"https://avatars.githubusercontent.com/u/15107518?v=3","gravatar_id":"","url":"https://api.github.com/users/kgorszczyk","html_url":"https://github.com/kgorszczyk","followers_url":"https://api.github.com/users/kgorszczyk/followers","following_url":"https://api.github.com/users/kgorszczyk/following{/other_user}","gists_url":"https://api.github.com/users/kgorszczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/kgorszczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgorszczyk/subscriptions","organizations_url":"https://api.github.com/users/kgorszczyk/orgs","repos_url":"https://api.github.com/users/kgorszczyk/repos","events_url":"https://api.github.com/users/kgorszczyk/events{/privacy}","received_events_url":"https://api.github.com/users/kgorszczyk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-31T22:55:27Z","updated_at":"2016-06-01T20:04:07Z","closed_at":null,"body":"Hi,\r\n\r\nim trying to add snowboy to a personal assistant app i've been working on but to be able to record the audio i first need to terminate all recording streams from snowboy otherwise i get an Audio Deivce Busy Error. \r\n\r\nAfter accessing detector.terminate() I can finally record my command and the python file processes it correctly. My only problem is, that while the prog loops detector.start(...) does not work anymore.\r\n\r\nIs there a way to reenable detector.start(...) so snowboy listens for the Hotword and then kill everything with detector.terminate() (And so on and on)? \r\n\r\nThanks :)"},"comment":{"url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/comments/223108178","html_url":"https://github.com/Kitt-AI/snowboy/issues/12#issuecomment-223108178","issue_url":"https://api.github.com/repos/Kitt-AI/snowboy/issues/12","id":223108178,"user":{"login":"xuchen","id":543547,"avatar_url":"https://avatars.githubusercontent.com/u/543547?v=3","gravatar_id":"","url":"https://api.github.com/users/xuchen","html_url":"https://github.com/xuchen","followers_url":"https://api.github.com/users/xuchen/followers","following_url":"https://api.github.com/users/xuchen/following{/other_user}","gists_url":"https://api.github.com/users/xuchen/gists{/gist_id}","starred_url":"https://api.github.com/users/xuchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuchen/subscriptions","organizations_url":"https://api.github.com/users/xuchen/orgs","repos_url":"https://api.github.com/users/xuchen/repos","events_url":"https://api.github.com/users/xuchen/events{/privacy}","received_events_url":"https://api.github.com/users/xuchen/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T20:04:07Z","updated_at":"2016-06-01T20:04:07Z","body":"Yes that should be easy, just move the last two lines in `HotwordDetector.__init__()` of `snowboydecoder.py`:\r\n\r\n        self.audio = pyaudio.PyAudio()\r\n        self.stream_in = self.audio.open(\r\n            input=True, output=False,\r\n            format=self.audio.get_format_from_width(\r\n                self.detector.BitsPerSample() / 8),\r\n            channels=self.detector.NumChannels(),\r\n            rate=self.detector.SampleRate(),\r\n            frames_per_buffer=2048,\r\n            stream_callback=audio_callback)\r\n\r\ndown to the start of the `start()` function, then you can repeatedly call `terminate()` and `start()`!"}}
{"actor":{"display_login":"xuchen"}}