wit-ai / pywit

Python library for Wit.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

speech() method does not work

Longman-Stan opened this issue · comments

Do you want to request a feature, report a bug, or ask a question about pywit?
bug
What is the current behavior?
It crashes, with "wit.wit.WitError: Wit responded with an error: Bad auth, check token/params"
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Run the attached script
What is the expected behavior?
Return the response of the server.
If applicable, what is the App ID where you are experiencing this issue? If you do not provide this, we cannot help.
It's included in the script.

I want to add that the message function works, so I think there is no problem with the token. I will also include de audio sample(in the zip file).

myspeech.zip
"""
from wit import Wit

access_token = '6XRNH6HQ6RMDOWLOEP75TXMEKRZACKT2'

client = Wit(access_token=access_token)
#resp = client.message('set an alarm tomorrow at 7am')
resp = None
with open('myspeech.wav', 'rb') as f:
resp = client.speech(f, None, {'Content-Type': 'audio/wav'})
print('Yay, got Wit.ai response: ' + str(resp))

Sorry for the delay. Please reset your token, this isn't meant to be shared.
Headers are now the second parameter. Let me know if the latest code is still resulting in the same error.