{"action":"created","issue":{"url":"https://api.github.com/repos/watsonbox/pocketsphinx-ruby/issues/12","labels_url":"https://api.github.com/repos/watsonbox/pocketsphinx-ruby/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/watsonbox/pocketsphinx-ruby/issues/12/comments","events_url":"https://api.github.com/repos/watsonbox/pocketsphinx-ruby/issues/12/events","html_url":"https://github.com/watsonbox/pocketsphinx-ruby/issues/12","id":62631885,"number":12,"title":"Don't lazy initialize PS decoder","user":{"login":"watsonbox","id":17737,"avatar_url":"https://avatars.githubusercontent.com/u/17737?v=3","gravatar_id":"","url":"https://api.github.com/users/watsonbox","html_url":"https://github.com/watsonbox","followers_url":"https://api.github.com/users/watsonbox/followers","following_url":"https://api.github.com/users/watsonbox/following{/other_user}","gists_url":"https://api.github.com/users/watsonbox/gists{/gist_id}","starred_url":"https://api.github.com/users/watsonbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watsonbox/subscriptions","organizations_url":"https://api.github.com/users/watsonbox/orgs","repos_url":"https://api.github.com/users/watsonbox/repos","events_url":"https://api.github.com/users/watsonbox/events{/privacy}","received_events_url":"https://api.github.com/users/watsonbox/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"watsonbox","id":17737,"avatar_url":"https://avatars.githubusercontent.com/u/17737?v=3","gravatar_id":"","url":"https://api.github.com/users/watsonbox","html_url":"https://github.com/watsonbox","followers_url":"https://api.github.com/users/watsonbox/followers","following_url":"https://api.github.com/users/watsonbox/following{/other_user}","gists_url":"https://api.github.com/users/watsonbox/gists{/gist_id}","starred_url":"https://api.github.com/users/watsonbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watsonbox/subscriptions","organizations_url":"https://api.github.com/users/watsonbox/orgs","repos_url":"https://api.github.com/users/watsonbox/repos","events_url":"https://api.github.com/users/watsonbox/events{/privacy}","received_events_url":"https://api.github.com/users/watsonbox/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-03-18T09:10:19Z","updated_at":"2015-03-19T11:52:24Z","closed_at":"2015-03-18T09:56:29Z","body":"As pointed out in #10, initializing the Pocketsphinx decoder actually changes configuration, which can be confusing since these values appear to be updated after the first decoding operation."},"comment":{"url":"https://api.github.com/repos/watsonbox/pocketsphinx-ruby/issues/comments/83522403","html_url":"https://github.com/watsonbox/pocketsphinx-ruby/issues/12#issuecomment-83522403","issue_url":"https://api.github.com/repos/watsonbox/pocketsphinx-ruby/issues/12","id":83522403,"user":{"login":"watsonbox","id":17737,"avatar_url":"https://avatars.githubusercontent.com/u/17737?v=3","gravatar_id":"","url":"https://api.github.com/users/watsonbox","html_url":"https://github.com/watsonbox","followers_url":"https://api.github.com/users/watsonbox/followers","following_url":"https://api.github.com/users/watsonbox/following{/other_user}","gists_url":"https://api.github.com/users/watsonbox/gists{/gist_id}","starred_url":"https://api.github.com/users/watsonbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watsonbox/subscriptions","organizations_url":"https://api.github.com/users/watsonbox/orgs","repos_url":"https://api.github.com/users/watsonbox/repos","events_url":"https://api.github.com/users/watsonbox/events{/privacy}","received_events_url":"https://api.github.com/users/watsonbox/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T11:52:24Z","updated_at":"2015-03-19T11:52:24Z","body":"@ojak Yes as I said in #10: \"Note that there would still be a 'two-phase' initialization - one when creating a `Configuration` and one when creating a `Decoder`.\"  In Pocketsphinx terms, the `Configuration` represents the command line options (or user options) which are passed to the decoder.  Then `ps_init` initializes a decoder which is represented by `Decoder`.\r\n\r\nThis gem is intended to wrap Pocketsphinx and while I'm not against adding a layer of useful behavior where absolutely necessary (i.e. #10), I don't want it to become a replacement implementation for various parts of Pocketsphinx.  In this case, digging around doing custom initialization with the `feat.params` feels like precisely that (i.e. providing a duplicate implementation of the private [`ps_init_defaults`](https://github.com/cmusphinx/pocketsphinx/blob/master/src/libpocketsphinx/pocketsphinx.c#L109)).\r\n\r\nIt looks like in theory this could be resolved quite easily in Pocketsphinx, by adding (or moving) the call to [`ps_init_defaults`](https://github.com/cmusphinx/pocketsphinx/blob/master/src/libpocketsphinx/pocketsphinx.c#L109) to the end of [`ps_default_search_args`](https://github.com/cmusphinx/pocketsphinx/blob/master/src/libpocketsphinx/pocketsphinx.c#L163).  Or even by exposing `ps_init_defaults` in the public API, with the configuration as a parameter instead of the decoder.  That's something that would need to be raised in the Pocketsphinx forums.\r\n\r\nI'll add a note to the Decoder section of the README to avoid confusion as much as possible for now."}}