Hi
I meet a problem for building a speech to text with Azure. I followed this tutorial
And nothing is possible with my speech config. I set it as following :
speech_config = speechsdk.SpeechConfig(subscription="{<!-- -->{MY SUBSCRIPTION KEY}}", region="westus")
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config)
I tried to re generate key many times, there is nothing to do I always get the error :
Speech Recognition canceled: CancellationReason.ErrorError details: WebSocket upgrade failed: Authentication error (401). Please check subscription information and region name.
I read everywhere that I certainly have a mistake in my key, or that my subscription is over, or I have reached the quota limit. But that's not the problem because I try with this method and get a success :
I followed advices of microsoft doc and tried this :
curl -v -X POST "https://YOUR_REGION.api.cognitive.microsoft.com/sts/v1.0/issueToken" -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" -H "Content-type: application/x-www-form-urlencoded" -H "Content-Length: 0"
And it worked, I got a token with success
Then I tried :
curl -v -X POST "https://YOUR_REGION.stt.speech.microsoft.com/speech/recognition/interactive/cognitiveservices/v1?language=en-US" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Transfer-Encoding: chunked" -H "Content-type: audio/wav; codec=audio/pcm; samplerate=16000" --data-binary @YOUR_AUDIO_FILE
And I got in text my audio_file
So that's not a problem of subscription, my key is valid.
So if anyone could help me to resolve this "Authentication Error Please check subscription" problem it would be amazing because it's making me mad since 3 days
Thank's for reading
