locked
Parameter 'instanceid' value '...' is invalid RRS feed

  • Question

  • Hi,

    I'd like to transcribe an audio file using curl to upload it. This is the bash script I'm using:

    #!/bin/bash
    
    CODEC=audio/pcm
    SAMPLE_RATE=8000
    WAV_FILE=audio.wav
    
    REQUEST_ID=b2c95ede-97eb-4c88-81e4-80f32d6aee24
    INSTANCE_ID=b2c95ede-97eb-4c88-81e4-80f32d6aee5
    DEVICE_OS=Linux
    LOCALE=de-DE
    
    ACCESS_TOKEN=XXX
    
    curl \
        -v \
        -X POST "https://speech.platform.bing.com/recognize?scenarios=smd&appid=D4D52672-91D7-4C74-8AD8-42B1D98141A5&locale=${LOCALE}&device.os=${DEVICE_OS}&version=3.0&format=json&instanceid=${INSTANCE_ID}&requestid=${REQUEST_ID}" \
        -H "Authorization: Bearer ${ACCESS_TOKEN}" \
        -H "Content-type: audio/wav; codec=$CODEC; samplerate=${SAMPLE_RATE}" \
        --data-binary @${WAV_FILE}
    

    But when I run this code, I get the following response:

    < HTTP/1.1 100 Continue
    * We are completely uploaded and fine
    < HTTP/1.1 400 Bad Request
    < Transfer-Encoding: chunked
    < Content-Type: text/plain
    < Server: Microsoft-IIS/8.5
    < X-MSEdge-Ref: Ref A: 6CCD3492570248168A20BB9A8887A26D Ref B: 38C07A6946D13C5572B72F28F1A31FFF Ref C: Thu Dec  8 02:35:08 2016 PST
    < Date: Thu, 08 Dec 2016 10:35:07 GMT
    < 
    Parameter 'instanceid' value 'b2c95ede-97eb-4c88-81e4-80f32d6aee5' is invalid.

    Why isn't Bing Speech accepting the instance id?

    Thanks for you help!

    Thursday, December 8, 2016 10:43 AM

Answers

  • The instance id must adhere to a specific format. I just copied the value of REQUEST_ID to INSTANCE_ID and it worked.

    • Marked as answer by Marc Püls Thursday, December 8, 2016 1:49 PM
    Thursday, December 8, 2016 1:49 PM