wit-ai / pywit

Python library for Wit.ai
Other
1.45k stars 359 forks source link

wit.speech() responds 400 bad request for no text noise #113

Closed damianchoc closed 6 years ago

damianchoc commented 6 years ago

Hi. When i use wit.speech() with *.wav where i didn't say anything, it responds wit.wit.WitError: Wit responden with status: 400 (Bad Request) and program stops.. what can i do with that?

blandinw commented 6 years ago

Hi :-) This is the intended behavior. You can try to catch the exception to avoid stopping the program. See how to use try/except in Python. You can also see a more detailed error message with something similar to:

try:
  # call to Wit
except Exception as e:
  print(e)

Hope this helps!

damianchoc commented 6 years ago

@blandinw oh ok, it works :) thanks for the answer!