12

I am facing an issue with the SFSpeechRecognizer. After few seconds of starting the application I start getting the error

Error Domain=kAFAssistantErrorDomain Code=209 "(null)"" and "Error Domain=kAFAssistantErrorDomain Code=203 "Timeout" UserInfo={NSLocalizedDescription=Timeout, NSUnderlyingError=0x170049990 {Error Domain=SiriSpeechErrorDomain Code=100 "(null)"}}

and the application stops recognization.

I am trying to endAudio() and then again start it every 20 seconds as Apple does not allow us to recognize for more than a minute.

Any help regarding this will really be appreciated.

MD. Khairul Basar
  • 4,237
  • 11
  • 38
  • 52
Veeral Arora
  • 129
  • 1
  • 6
  • 2
    Did you find any solution? We have just hit this on an iOS 11 device. – shelll Sep 27 '17 at 10:37
  • I have the same thing. It only though happens if I have QuickTime mirroring my app at the same time. I have a hunch it might direct the voice input to laptop or something similar... – Rauli Rikama Oct 05 '17 at 11:19
  • maybe try on the device only as these errors are not consistent on the simulator vs a real device – user798719 Aug 14 '18 at 16:49
  • I am getting exactly the same thing: Error 209, 203 and 100 – user6631314 Oct 29 '18 at 14:34
  • I am having the same issue with `endAudio()`. But for continuous transcribing, I have tried to call it every minute, so that I wouldn't have to call `endAudio()`, and the speech recognition still works fine. – carrotzoe Mar 05 '19 at 14:58

1 Answers1

6

This work for me. Try this when you want to close the recognitiontask:

DispatchQueue.main.async { [unowned self] in
        guard let task = self.recognitionTask else {
            fatalError("Error")
        }
        task.cancel()
        task.finish()
    }
Alberto
  • 1,029
  • 7
  • 8