{"action":"created","issue":{"url":"https://api.github.com/repos/Uberi/speech_recognition/issues/100","repository_url":"https://api.github.com/repos/Uberi/speech_recognition","labels_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/100/comments","events_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/100/events","html_url":"https://github.com/Uberi/speech_recognition/issues/100","id":144495403,"number":100,"title":"Alsa lib error while running program and it automatically set particular threshold value always","user":{"login":"santhoshrsk","id":15628738,"avatar_url":"https://avatars.githubusercontent.com/u/15628738?v=3","gravatar_id":"","url":"https://api.github.com/users/santhoshrsk","html_url":"https://github.com/santhoshrsk","followers_url":"https://api.github.com/users/santhoshrsk/followers","following_url":"https://api.github.com/users/santhoshrsk/following{/other_user}","gists_url":"https://api.github.com/users/santhoshrsk/gists{/gist_id}","starred_url":"https://api.github.com/users/santhoshrsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santhoshrsk/subscriptions","organizations_url":"https://api.github.com/users/santhoshrsk/orgs","repos_url":"https://api.github.com/users/santhoshrsk/repos","events_url":"https://api.github.com/users/santhoshrsk/events{/privacy}","received_events_url":"https://api.github.com/users/santhoshrsk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-03-30T07:57:59Z","updated_at":"2016-09-10T07:26:10Z","closed_at":null,"body":"Steps to reproduce\r\n------------------\r\n\r\nInitially when i was working with this program in my raspberry pi running jessie, everything went so fine. But from today morning it is not picking any audio from  usb microphone and always setting threshold values as 48.5477227879 even high noise and low noise situation.\r\n\r\nso i tried to reinstall program again, eventhough it didnt worked for me.\r\n\r\nafter running __main__.py program it shows \r\n\r\n\"a moment of silence please..\r\nSet minimum threshold to 48.5477227879\r\nsay something!\r\n                             \"\r\n\r\nthats it, after this nothing is happening.\r\n\r\nAfter some time i tried to run it through terminal, it shiows error as \r\n\" ALSA lib pcm_dmix.c :1022:(snd_pcm_dmix_open) unable to open slave\"\r\nsay some thing\r\n\r\nwhat shall i do now to make this program run.\r\n\r\nExpected behaviour\r\n------------------\r\n\r\nRun program without error and recognise speech.\r\n\r\nActual behaviour\r\n----------------\r\n\r\nscenario 1: Running from python\r\n\r\nprogram running , no error, it shows\r\n \"a moment of silence please..\r\nSet minimum threshold to 48.5477227879\r\nsay something!  \" \r\n\r\nand stay like this for whole time.\r\n\r\nscenario 2: Running from terminal\r\n\r\n\"ALSA lib pcm_dmix.c :1022:(snd_pcm_dmix_open) unable to open slave\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm rear\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm center_lfe\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm side\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm hdmi\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm hdmi\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm modem\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm modem\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm phoneline\r\nALSA lib pcm.c:2289:(snd_pcm_open_noupdate) unknown PCM cards.pcm phoneline\r\nALSA lib pcm_dmix.c :1022:(snd_pcm_dmix_open) unable to open slave\r\nSay something\"\r\n\r\nand stay like this at all, no more recognition.\r\n\r\n\r\nSystem information\r\n------------------\r\n\r\n\r\nMy **SpeechRecognition library version** is <3.3.3>. \r\n\r\nMy **PyAudio library version** is <0.2.9> \r\n\r\nI **installed PocketSphinx from** Debian repositories.\r\n"},"comment":{"url":"https://api.github.com/repos/Uberi/speech_recognition/issues/comments/246096952","html_url":"https://github.com/Uberi/speech_recognition/issues/100#issuecomment-246096952","issue_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/100","id":246096952,"user":{"login":"manishsharma1992","id":6358102,"avatar_url":"https://avatars.githubusercontent.com/u/6358102?v=3","gravatar_id":"","url":"https://api.github.com/users/manishsharma1992","html_url":"https://github.com/manishsharma1992","followers_url":"https://api.github.com/users/manishsharma1992/followers","following_url":"https://api.github.com/users/manishsharma1992/following{/other_user}","gists_url":"https://api.github.com/users/manishsharma1992/gists{/gist_id}","starred_url":"https://api.github.com/users/manishsharma1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manishsharma1992/subscriptions","organizations_url":"https://api.github.com/users/manishsharma1992/orgs","repos_url":"https://api.github.com/users/manishsharma1992/repos","events_url":"https://api.github.com/users/manishsharma1992/events{/privacy}","received_events_url":"https://api.github.com/users/manishsharma1992/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T07:26:10Z","updated_at":"2016-09-10T07:26:10Z","body":"@Uberi I have a similar problem with speech_recognition, I ran you code on terminal it gave me below output\r\n\r\n`python -c \"import pyaudio;audio=pyaudio.PyAudio();print([audio.get_device_info_by_index(i) for i in range(audio.get_device_count())])\"`\r\n\r\nIt gave me following output\r\n\r\n```\r\nALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear\r\nALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe\r\nALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side\r\nALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map\r\nALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map\r\nALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map\r\nALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map\r\n[\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': 0.005804988662131519,\r\n    'maxInputChannels': 2L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 0,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'HDA Intel: 92HD71B7X Analog (hw:0,0)',\r\n    'defaultHighInputLatency': 0.034829931972789115\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 1,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'HDA Intel: 92HD71B7X Digital (hw:0,1)',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 2,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 8L,\r\n    'name': u'HDA Intel: HDMI 0 (hw:0,3)',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 48000.0,\r\n    'defaultLowOutputLatency': 0.021333333333333333,\r\n    'defaultLowInputLatency': 0.021333333333333333,\r\n    'maxInputChannels': 128L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 3,\r\n    'defaultHighOutputLatency': 0.021333333333333333,\r\n    'maxOutputChannels': 128L,\r\n    'name': u'sysdefault',\r\n    'defaultHighInputLatency': 0.021333333333333333\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 4,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'front',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 5,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'surround40',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 6,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'surround51',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 7,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'surround71',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 8,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'iec958',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 9,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'spdif',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.005804988662131519,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 10,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 8L,\r\n    'name': u'hdmi',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.008707482993197279,\r\n    'defaultLowInputLatency': 0.008707482993197279,\r\n    'maxInputChannels': 32L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 11,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 32L,\r\n    'name': u'pulse',\r\n    'defaultHighInputLatency': 0.034829931972789115\r\n  },\r\n  {\r\n    'defaultSampleRate': 48000.0,\r\n    'defaultLowOutputLatency': 0.021333333333333333,\r\n    'defaultLowInputLatency': -1.0,\r\n    'maxInputChannels': 0L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 12,\r\n    'defaultHighOutputLatency': 0.021333333333333333,\r\n    'maxOutputChannels': 2L,\r\n    'name': u'dmix',\r\n    'defaultHighInputLatency': -1.0\r\n  },\r\n  {\r\n    'defaultSampleRate': 44100.0,\r\n    'defaultLowOutputLatency': 0.008707482993197279,\r\n    'defaultLowInputLatency': 0.008707482993197279,\r\n    'maxInputChannels': 32L,\r\n    'structVersion': 2L,\r\n    'hostApi': 0L,\r\n    'index': 13,\r\n    'defaultHighOutputLatency': 0.034829931972789115,\r\n    'maxOutputChannels': 32L,\r\n    'name': u'default',\r\n    'defaultHighInputLatency': 0.034829931972789115\r\n  }\r\n]\r\n```\r\nBelow is my code, I am trying to execute\r\n\r\n```\r\nimport aiml\r\nimport pyttsx\r\nimport pyaudio\r\nimport speech_recognition as sr\r\nimport os\r\n\r\nkernel = aiml.Kernel()\r\n\r\nr = sr.Recognizer()\r\n\r\nengine = pyttsx.init('espeak')\r\nrate = engine.getProperty('rate')\r\n\r\nengine.setProperty('rate', rate-50)\r\n\r\nif os.path.isfile(\"bot_brain.brn\"):\r\n    kernel.bootstrap(brainFile = \"bot_brain.brn\")\r\nelse:\r\n    kernel.bootstrap(learnFiles = \"std-startup.xml\", commands = \"load aiml b\")\r\n    kernel.saveBrain(\"bot_brain.brn\")\r\n\r\n# Press CTRL-C to break this loop\r\nwhile True:\r\n\twith sr.Microphone() as source:\r\n\t\tprint(\"Say something!\")\r\n\t\taudio = r.listen(source)\r\n\ttry:\r\n\t\tprint(\"You said : \" + r.recognize_google(audio))\r\n\t\tinput = r.recognize_google(audio)\r\n#\t\tinput = raw_input(\"Enter your message >> \")\r\n\t\tresponse = kernel.respond(input)\r\n\t\tprint response\r\n\t\tengine.say(response)\r\n\t\tengine.runAndWait()\r\n\texcept sr.UnknownValueError:\r\n\t\tprint(\"I could not understand what you just said\")\r\n\texcept sr.RequestError as e:\r\n\t\tprint(\"Could not request results\".format(e))\r\n```\r\n\r\nCan you please guide me where I am going wrong... Thanks in advance."}}
{"actor":{"display_login":"manishsharma1992"}}