SFSpeechRecognizer not working in background. we are getting error in recognizationRequest completion handler with error code : Domain=kAFAssistantErrorDomain Code=1700 . Thanks in advance.

Based on Apple's SpeakToMe sample (https://developer.apple.com/library/prerelease/content/samplecode/SpeakToMe/Introduction/Intro.html) I've enabled audio in background modes, but I get the following error inside the resultHandler enclosure from method speechRecognizer.recognitionTaskWithRequest:


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


It works fine in foreground. There's no documentation explaining what error 1700 is.


Steps to Reproduce:

-Download https://developer.apple.com/library/prerelease/content/samplecode/SpeakToMe/Introduction/Intro.html

-Enable background mode

-Run startRecording() in background

-Expect for error in "recognitionTask = speechRecognizer.recognitionTaskWithRequest(recognitionRequest, resultHandler: { (result, error)"


Expected Results:

The result object


Actual Results:

The error: Error Domain=kAFAssistantErrorDomain Code=1700

Replies

i am having the same issue in ios 13. I got the following error,


2020-01-21 15:30:41.549170+0530 Pro@Me[2212:613705] [Utility] +[AFAggregator logDictationFailedWithError:] Error Domain=kAFAssistantErrorDomain Code=1700 "(null)"

2020-01-21 15:30:41.553271+0530 Pro@Me[2212:613445] [aurioc] AURemoteIO.cpp:1590:Start: AUIOClient_StartIO failed (561145187)

2020-01-21 15:30:41.553429+0530 Pro@Me[2212:613445] [avae] AVAEInternal.h:109 [AVAudioEngineGraph.mm:1544:Start: (err = PerformCommand(*ioNode, kAUStartIO, NULL, 0)): error 561145187

2020-01-21 15:30:41.556057+0530 Pro@Me[2212:613445] THREAD WARNING: ['SpeechRecognition'] took '42.260986' ms. Plugin should use a background thread.

2020-01-21 15:30:41.556959+0530 Pro@Me[2212:613445] startListening() recognitionTask error: Error Domain=kAFAssistantErrorDomain Code=1700 "(null)"