Closed triceam closed 7 years ago
Update: I have tried with pretty much every sound format option, and the only one that seems to be partially working is wav, but that is still inconsistent.
Resolved due to entering invalid credentials.
This issue points to a known problem where the 401 Not Authorized
response isn't returned until the third or fourth request to the Text to Speech service, leading to unnecessary confusion on the users' part. We'll need to continue following up with the text to speech team to understand why this is occurring.
I have an iOS app that is leveraging text to speech to provide audible response to user input. Sometimes the service works fine, other times it fails (two different errors). Most of the time, it is within the exact same session within the app. I am using the sample code here, with very few (if any) modifications: https://github.com/watson-developer-cloud/swift-sdk#text-to-speech
The errors I am seeing:
textToSpeech.synthesize(text, voice: SynthesisVoice.gb_Kate.rawValue, audioFormat:AudioFormat.l16 ,failure: failure) { data in
exactly, and only swappedgb_Kate
withus_Allison
andus_Lisa
, but neither appears to work.noData
in the Xcode console.Error Domain=com.ibm.watson.developer-cloud.TextToSpeechV1 Code=401 "Not Authorized"
in the Xcode console.Between items 2 and 3 above, they happens within the same app session with no code changes.
This is happening in response to a service query. I have tried calling speech to text and playing the synthesized audio in the main thread, but it doesn't seem to make a difference.