wit-ai / pywit

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

Error on speech recognition for not english language #128

Closed rickkyltl closed 5 years ago

rickkyltl commented 5 years ago

Hello everyone

I tried to use speech recognition of Wit.ai for Thai language by post api and pywit like this :

API_ENDPOINT = 'https://api.wit.ai/speech
headers = {'authorization':'Bearer ' + ACCESS_TOKEN,'Content-Type':'audio/wav'}
with open(WAVE_FILENAME,'rb') as f:
        resp = requests.post(API_ENDPOINT, headers = headers, data=f)
        data = json.loads(resp.content)
print(data)

and

    with open(WAVE_FILENAME, 'rb') as f:
        resp = client.speech(f, None, {'Content-Type': 'audio/wav'})
    print(resp)

I got result as

{'error': 'Speech recognition is not supported for language: Thai', 'code': 'bad-request'}

and

wit.wit.WitError: Wit responded with status: 400 (Bad Request)

However,if I change language in my app to English ,these code are work fine. I also tried to change language to another, this error appear with the language that in Beta.

Could you please help me with this problem Thank,

jtliao commented 5 years ago

hi, unfortunately, we only support speech recognition for a select number of languages at the moment, we are looking to add more in the future