{"action":"created","issue":{"url":"https://api.github.com/repos/Uberi/speech_recognition/issues/163","repository_url":"https://api.github.com/repos/Uberi/speech_recognition","labels_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/163/comments","events_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/163/events","html_url":"https://github.com/Uberi/speech_recognition/issues/163","id":182456026,"number":163,"title":"Google Speech API is not recognizing audio file","user":{"login":"pankug","id":12581773,"avatar_url":"https://avatars.githubusercontent.com/u/12581773?v=3","gravatar_id":"","url":"https://api.github.com/users/pankug","html_url":"https://github.com/pankug","followers_url":"https://api.github.com/users/pankug/followers","following_url":"https://api.github.com/users/pankug/following{/other_user}","gists_url":"https://api.github.com/users/pankug/gists{/gist_id}","starred_url":"https://api.github.com/users/pankug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pankug/subscriptions","organizations_url":"https://api.github.com/users/pankug/orgs","repos_url":"https://api.github.com/users/pankug/repos","events_url":"https://api.github.com/users/pankug/events{/privacy}","received_events_url":"https://api.github.com/users/pankug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-12T07:39:27Z","updated_at":"2016-10-15T07:09:33Z","closed_at":null,"body":"Hello,\r\n\r\nJust started to use  speech_recognition in my project.\r\nThe wit.ai API is working good but the Google API is failing for same API.\r\n\r\n\r\nfrom os import path\r\nAUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), \"whats.wav\")\r\n\r\nr = sr.Recognizer()\r\nwith sr.AudioFile(AUDIO_FILE) as source:\r\n    audio = r.record(source) # read the entire audio file\r\n\r\n\r\n# recognize speech using Wit.ai\r\nWIT_AI_KEY = \"\"\r\ntry:\r\n    print(\"Wit.ai thinks you said \" + r.recognize_wit(audio, key=WIT_AI_KEY))\r\nexcept sr.UnknownValueError:\r\n    print(\"Wit.ai could not understand audio\")\r\nexcept sr.RequestError as e:\r\n    print(\"Could not request results from Wit.ai service; {0}\".format(e))\r\n\r\n\r\n\r\n## Google Speech Reciginition API\r\ntry:\r\n   print(\"Google Speech Recognition thinks you said \" + r.recognize_google(audio,  key=\"\"))\r\nexcept sr.UnknownValueError:\r\n    print(\"Google Speech Recognition could not understand audio\")\r\nexcept sr.RequestError as e:\r\n    print(\"Could not request results from Google Speech Recognition service; {0}\".format(e))\r\n\r\n\r\nThe same code i am using, The wit.ai is correctly recognizing the audio and showing text but google API is showing No such file or directory.\r\nFile \"/usr/local/lib/python2.7/dist-packages/speech_recognition/__init__.py\", line 660, in recognize_google\r\n    convert_width = 2 # audio samples must be 16-bit\r\n  File \"/usr/local/lib/python2.7/dist-packages/speech_recognition/__init__.py\", line 386, in get_flac_data\r\n    ], stdin=subprocess.PIPE, stdout=subprocess.PIPE)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 710, in __init__\r\n    errread, errwrite)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 1327, in _execute_child\r\n    raise child_exception\r\nOSError: [Errno 2] No such file or directory\r\n"},"comment":{"url":"https://api.github.com/repos/Uberi/speech_recognition/issues/comments/253967681","html_url":"https://github.com/Uberi/speech_recognition/issues/163#issuecomment-253967681","issue_url":"https://api.github.com/repos/Uberi/speech_recognition/issues/163","id":253967681,"user":{"login":"Uberi","id":437196,"avatar_url":"https://avatars.githubusercontent.com/u/437196?v=3","gravatar_id":"","url":"https://api.github.com/users/Uberi","html_url":"https://github.com/Uberi","followers_url":"https://api.github.com/users/Uberi/followers","following_url":"https://api.github.com/users/Uberi/following{/other_user}","gists_url":"https://api.github.com/users/Uberi/gists{/gist_id}","starred_url":"https://api.github.com/users/Uberi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Uberi/subscriptions","organizations_url":"https://api.github.com/users/Uberi/orgs","repos_url":"https://api.github.com/users/Uberi/repos","events_url":"https://api.github.com/users/Uberi/events{/privacy}","received_events_url":"https://api.github.com/users/Uberi/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T07:09:33Z","updated_at":"2016-10-15T07:09:33Z","body":"Hi @pankug,\r\n\r\nPlease upload the WAV file that is causing the issue, as well as any custom code that is necessary to reproduce it.\r\n\r\nAlso, it looks like your code didn't install correctly. Try running `pip install --reinstall SpeechRecognition` and see if that fixes the problem.\r\n\r\nTo check your installation, it would also be helpful to know the output of the following command:\r\n\r\n```bash\r\nls -la /usr/local/lib/python2.7/dist-packages/speech_recognition\r\n```"}}
{"actor":{"display_login":"Uberi"}}