Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speech() method does not work #137

Closed
Longman-Stan opened this issue Feb 24, 2020 · 1 comment
Closed

speech() method does not work #137

Longman-Stan opened this issue Feb 24, 2020 · 1 comment

Comments

@Longman-Stan
Copy link

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))

@patapizza
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants