Closed kamarshad closed 5 years ago
Can someone help me in regard to above issue? @jthomas @schen22 @HughMorrow @tmarkiewicz @glennrfisher It would be a great help.
Since you're using IBM's public cloud, you don't need to set the iamUrl
parameter in the SpeechToText
initializer. Try removing that parameter and see if it authenticates properly.
Hello @AnthonyOliveri
Thank you for your reply. I also tried initializing the SpeechToText
only with apikey
but not able to authenticate and got the error below.
speechToText = SpeechToText(apiKey: Credentials.SpeechToTextAPIKey)
Error log
WSError(type: Starscream.ErrorType.upgradeError, message: "Invalid HTTP upgrade", code: 401)
That error is coming from a third party dependency Starscream
, so I won't be able to help as much with that. I did a google search of the error, which returned a LOT of issues that have been opened against Starscream for that error message. Hopefully one of those issues contains the solution you need.
Can you try using the recognize method that doesn't use websockets? That way we can see if this error is in fact specific to Starscream, which handles the websocket connections.
Hello @AnthonyOliveri,
Thanks for your reply. Yesterday released version 1.0.0
solved the issue but if one create the service in Dallas region(though not verified it for other region). And apikey
is sufficient for intantiating the SpeechToText
speechToText = SpeechToText(apiKey: Credentials.SpeechToTextAPIKey)
Honestly, I'm not sure how that resolved the issue, but I'm glad it did!
To clarify, are you saying that it does or does not work in Dallas?
I have tested it for Dallas region and it is working fine for it. Thank you
@kamarshad If you're using locations other than Dallas, make sure to set the serviceURL
property of your SpeechToText
instance. I was also struggling with the same authentication 401 errors thrown by Starscream until I read through the readme again in the swift-sdk repository:
https://github.com/watson-developer-cloud/swift-sdk
So, if your Watson service location was Tokyo, for example, you'd want the following:
let speechToText = SpeechToText(apiKey: "your-api-key")
speechToText.serviceURL = "https://gateway-tok.watsonplatform.net/speech-to-text/api"
I want to transcribe the real-time audio and using this library for the same. I have installed it through cocoa pods (Also tried integrating it using the Carthage got the same error.). I am stuck with an issue (authentication) while transcribing the audio to text.
The installed STT sdk version is 0.38.1.
I have configured everything correctly, created the service at (https://console.bluemix.net/catalog/services/speech-to-text) and using the correct credential and also making sure
SpeechToText
instantiated with properapikey
andURL
. Whenever I call thestartStreaming
method sdk prints some error log, which might be related to the authentication challenge.sdk auto printed logs
Logs printed in error clouser
Error: failure(401, "unauthorized")
Error localised info: The operation couldn’t be completed. (RestKit.RestError error 0.)
Xcode:
10.1
iPhone device:iPhoneX(12.0)/iPhone7(11.4)
Looking for your help Thanks