Just started to play with Watson's Voice API. Trying to use their demo file audio-file.flac. You'd have to take my word for it that I'm posting the curl command from the directory where it resides, and that according to the ls-l command the file size is 285928 bytes.
This is my post
curl -X POST -u xxxxxxxxxx-:yyyyyyyy --header "Content-Type: audio/flac" --data-binary "audio-file.flac" "https://stream.watsonplatform.net/speech-to-text/api/v1/recognize"
and I get back
{ "code_description": "Bad Request", "code": 400, "error": "Stream was 15 bytes but needs to be at least 100 bytes." }
It's the stream size that makes wonder. I have a great internet connection, and no matter how many times I try it comes back as 15. If I change the filename to an incorrect name it reports back as 0. So where is this 15 coming from?
Anyone have any experience with this?
Thanks
The issue is here:
--data-binary "audio-file.flac"
You are telling the command line to send the 15 bytes of your filename as the content of your message. That's why it is failing.
Prepend the filename with an @
sign. Example:
--data-binary @audio-file.flac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With