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.
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()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With