wit-ai / wit

Natural Language Interface for apps and devices
https://wit.ai/
931 stars 91 forks source link

/dictation api not returning proper .json | result for long audio files is split into multiple "is_final"=true #2629

Open realCatScratch opened 1 year ago

realCatScratch commented 1 year ago

I am having the problem that the /dictation API is not returning proper json format. If I change the endpoint in the existing pywit lib to /dictation there is the following error "requests.exceptions.JSONDecodeError: Extra data line xx column yy (char zzz)"

All other attempts to decode or format the response "as is" to JSON have failed.

I then tried my own approach to request the /dictation-API and regex myself to the "is_final=true" section, extract the chars and format as proper JSON but then found out that for long audio files there are multiple "is_final"=true sections, see example (extracted text from the response object): dictation_result_long_audio_de-DE.txt

attached also the long audio file in German 2015-01-27-12-32-58.wave.zip