0

I am trying to make a speech2text request to Bing Speech API but I get

HTTP/1.1 408 Request timed out (> 14000 ms)

error

my curl command is as following :

curl -v -X POST "https://speech.platform.bing.com/recognize?scenarios=smd&appid=D4D52672-91D7-4C74-8AD8-42B1D98141A5&locale=en-US&device.os=your_device_os&version=3.0&format=json&instanceid=my-instanceid&requestid=my-request-id" -H 'Authorization: Bearer my-token' -H 'Content-type: audio/wav; codec="audio/pcm"; samplerate=16000' --data-binary @whatstheweatherlike.wav

file I am trying to upload is

https://github.com/Microsoft/BotBuilder-Samples/blob/master/Node/intelligence-SpeechToText/audio/whatstheweatherlike.wav

any ideas what might went wrong?

wonglik
  • 1,043
  • 4
  • 18
  • 36

2 Answers2

0

You have a link to the GitHub page for the WAV file, not the WAV file itself. Use https://raw.githubusercontent.com/Microsoft/BotBuilder-Samples/master/Node/intelligence-SpeechToText/audio/whatstheweatherlike.wav instead.

cthrash
  • 2,938
  • 2
  • 11
  • 10
  • I linked to github page in SO question. But in the project I have downloaded the file and I am triggering the command from that directory. – wonglik Dec 12 '16 at 20:12
  • What shows if you type `file whatstheweatherlike.wav` in this directory? It should say: `whatstheweatherlike.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz` – cthrash Dec 13 '16 at 01:07
  • it says : whatstheweatherlike.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz – wonglik Dec 13 '16 at 06:15
  • This is the exact lines I tried: https://gist.github.com/cthrash/4c9db0c7e89cde36cbc520a9c070a747, and it works as intended. One other thing to watch out for is if the .wav file is not in the immediate directory, curl can be wonky. See http://stackoverflow.com/questions/16615900/sending-json-files-in-curl-requests-with-absolute-or-relative-paths – cthrash Dec 13 '16 at 22:19
  • Content lenght > 0 so it is sending the file. I implemented same logic with nodejs and it worked so it seems that it was something related to curl – wonglik Dec 14 '16 at 06:38
0

It seems it was something cUrl related as I implemented same logic in nodejs and it works fine.

wonglik
  • 1,043
  • 4
  • 18
  • 36