watson-developer-cloud / speech-to-text-swift

Speech-to-Text example using the Swift SDK
Apache License 2.0
34 stars 17 forks source link

Getting error to run transcription #4

Closed leandrodvd closed 6 years ago

leandrodvd commented 7 years ago

Hi,

I'm trying to run this sample but I'm getting this error when I start the transcription (for both file and microphone)

Error Domain=WebSocket Code=403 "Invalid HTTP upgrade" UserInfo={NSLocalizedDescription=Invalid HTTP upgrade}

So far I tried it only in XCode Simulator for iPhone 6/7. Is it expected to work in the simulator or do I need a real device to test ?

glennrfisher commented 7 years ago

Hi @leandrodvd. I think this issue is related to the transition from HTTP to WebSockets. It cropped up frequently during early development of Speech to Text, but seemed to disappear when we moved to newer versions of the Starscream WebSockets library.

Would you mind trying to run your code several more times? Is this a consistent issue or intermittent? If intermittent, is it relatively common or relatively rare?

If you run into this problem often, then perhaps there are upstream changes to the Starscream WebSockets library that we should integrate into the SDK.

glennrfisher commented 6 years ago

Just a note that we've updated the Watson Swift SDK to use the latest version of Starscream. This issue should be resolved.