Error Domain=kAFAssistantErrorDomain Code=209 “(null)”

跟風遠走 提交于 2020-01-02 01:14:06

问题


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.


回答1:


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()
    }


来源:https://stackoverflow.com/questions/46032110/error-domain-kafassistanterrordomain-code-209-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!