Closed glennrfisher closed 7 years ago
I am getting the same error message of unexpected audio format. I am using an English voice. So would this be related to credentials or a problem with accessing the audio. I am creating an iOS app and the error starts with "error was generated Error Domain=com.ibm.watson.developer-cloud.TextToSpeechV1..."
They are working on changing this to be a json response. It will be out soon
Hi @rhondakayshow. Can you check your credentials and try again? Our test suite is passing, so I think the error is caused by invalid credentials.
@germanattanasio Good to hear! That will be a lot easier to parse.
I'm also finding this error to be quite misleading - banged my head against the wall for a while before seeing this post. thanks!
Thanks for the feedback, @etayluz! That's really helpful for us to understand the SDK's pain points.
@germanattanasio Do you happen to know the status of the JSON response for invalid credentials? Was it shelved or are there still folks working on that?
I think the fix should be there.
If that's not the case can we parse the 401 errors for now?
Service credentials are checked before any service is contacted. As a result, errors related to invalid credentials do not match the JSON error format advertised by a service.
Since this is a common error that may occur, we should add support for parsing it and producing a meaningful error message.
With
synthesize
in Text to Speech, for example, such an error would not be parsed by thedataToError
function. Instead, it would pass through and be interpreted as WAV data. Verifying the format of the WAV data would fail, resulting in an unhelpful error message:Returned audio is in an unexpected format.
Here is an example of the response that is returned: