https://github.com/watson-developer-cloud/speech-to-text-swift
IBM Watson speech-to-text sample code for iOS doesn’t work as is. If you get an Error code like:
WSError(type: Starscream.ErrorType.upgradeError, message: "Invalid HTTP upgrade", code: 403)
You need adds some code whereas SpeechToText initialize.
For SpeechToText()
speechToText = SpeechToText(
apiKey: Credentials.SpeechToTextApiKey
)
speechToText.serviceURL = "SPEECH_TO_TEXT_URL"
For SpeechToTextSession()
session = SpeechToTextSession(
apiKey: Credentials.SpeechToTextApiKey
)
session.websocketsURL = "SPEECH_TO_TEXT_URL + /v1/recognize"
*SPEECH_TO_TEXT_URL is in your credential.
I hope this will help you.