Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Domain=kAFAssistantErrorDomain Code=209 "(null)"

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.

like image 239
Veeral Arora Avatar asked Sep 04 '17 07:09

Veeral Arora


1 Answers

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()
    }
like image 192
Alberto Avatar answered Oct 16 '22 23:10

Alberto