nikhilkumarsingh / Wit-Speech-API-Wrapper

A python client for interacting with Wit Speech Recognition API
24 stars 7 forks source link

I have an error in ubuntu 16.04 #1

Closed mrmrn closed 7 years ago

mrmrn commented 7 years ago

hi. I installed all packages and run your code.it can recognize my voice and when my voice is stopped but give me an error. here is the terminal log:


reka@marn ~/s/Wit-Speech-API-Wrapper> python speech_to_text.py
ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
Listening...
Finished recording.
Traceback (most recent call last):
  File "speech_to_text.py", line 39, in <module>
    text =  RecognizeSpeech('myspeech.wav', 4)
  File "speech_to_text.py", line 32, in RecognizeSpeech
    text = data['_text']
KeyError: '_text'
reka@marn ~/s/Wit-Speech-API-Wrapper> 
nikhilkumarsingh commented 7 years ago

It seems the HTTP response object doesn't have "_text" key. Can you please just print data dictionary? It seems to be an issue with Wit Speech API.

mrmrn commented 7 years ago

yeah, you are right. It was the access token problem. now it works like a charm but have some problems I will ask you in another issues. thank you for your fast response.

hassanikram commented 4 years ago

File "speech_to_text.py", line 39, in text = RecognizeSpeech('myspeech.wav', 4) File "speech_to_text.py", line 32, in RecognizeSpeech text = data['_text'] KeyError: '_text'

I'm getting this error can you please help?