I am trying to submit an audio in ogg format to https://api.wit.ai/speech?v=20200513. I need to receive a text representation of the voice. When I submit the code through curl request, it returns empty response as {"_text": "", "entities": ""}
. I also tried to execute it with pywit. Below is the code:
from wit import Wit
client = Wit('XXXXXXXXXXXXXXXXX')
with open('2.ogg', 'rb') as f:
print(f)
resp = client.post_speech(f, content_type='audio/ogg')
print('Yay, got Wit.ai response: ' + str(resp))
My guess was that the file is not captured, but print shows _io.BufferedReader name='2.ogg'
, which means that the file is stored in the buffer, but wit ai refuses to transcribe it.
Why does wit respond with empty _text
?