Azure-Samples / Cognitive-Speech-STT-iOS

iOS SDK for the Microsoft Speech-to-Text API, part of Cognitive Services
https://www.microsoft.com/cognitive-services/en-us/speech-api
Other
49 stars 21 forks source link

MicrophoneRecognitionClient stops working after onError callback #4

Closed phongcao closed 7 years ago

phongcao commented 8 years ago

Repro Steps:

  1. Press start button.
  2. Quickly switch the airplane mode on and off in order to simulate the network connection drops.
  3. onError callback returns: "Transport error Unknown error: -2147418113".
  4. Press start button again.
  5. The app stops working with error: "_SpeechClientStatusMicrophoneInUse".

When this issue happens, it doesn't help even if I try to stop the recognition using endMicAndRecognition method or re-initialize the MicrophoneRecognitionClient. The only way is to reset the app.

quij commented 8 years ago

This has been happening to me too. Though in my case, it was while running the app with a simulated poor connection.

On an iPhone:

  1. Settings > Developer > Network Link Conditioner Status > Enable > Very Bad Network.
  2. Launch SpeechRecognitionServerExample.
  3. Press start button.
  4. onError callback returns: "Transport error Unknown error: -2147418113".
  5. Press start button again.
  6. The app stops working with error: "_SpeechClientStatusMicrophoneInUse".

After getting the _SpeechClientStatusMicrophoneInUse status, any subsequent calls to endMicAndRecognition never return (the app just hangs).

jasonvomsft commented 7 years ago

Can you verify if the latest SDK has addressed the issue?

phongcao commented 7 years ago

It seems to work great now. Thanks!