2
votes

The API has changed from examples I have seen on Stack Overflow. Just trying to work through the example given by IBM. It seems straightforward and it generates an output, but that output a 118 byte WAV file that is obvious wrong. I have tried substituting the Hello World text, but I still get a 118 byte WAV file.

I am sending this in the Windows command line - note I changed the API Key and URL from the one given to me by IBM:

curl -X POST -u "apikey:iX5v_SY8WwuvfQR9VQ9sfggewC0788ineyFO9ocg" --header "Content-Type: application/json" --header "Accept: audio/wav" --data "{\"text\":\"Hello World\"}" --output hello_world.wav "https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/4ad31fed-af42-4fa0-8ef8-e14dquev40ca/v1/synthesize"

1

1 Answers

0
votes

The issue here is that you are piping the output to file.

--output hello_world.wav 

If the output is a wav file then all is OK, but if the response is an error code then that is what will be inside your .wav file. If you open it with an editor - you might need to convert it to a text file - you should see an error.