I am executing SpeakToMe code (
https://developer.apple.com/library/content/samplecode/SpeakToMe/Introduction/Intro.html
)
provided by apple on an iPad.

Most of the time it works fine, however sometimes it does not recognize
speech by user, below is the part of code which does not work as expected
in such scenarios:

recognitionTask = speechRecognizer.recognitionTask(with:
recognitionRequest) { result, error in
            var isFinal = false

            if let result = result {
                self.textView.text =
result.bestTranscription.formattedString
                isFinal = result.isFinal
            }

            if error != nil || isFinal {
                self.audioEngine.stop()
                inputNode.removeTap(onBus: 0)

                self.recognitionRequest = nil
                self.recognitionTask = nil

                self.recordButton.isEnabled = true
                self.recordButton.setTitle("Start Recording", for: [])
            }
        }

In above code following error is obtained:

SiriCoreSiriConnectionErrorDomain - code 4

Also I noticed that Siri stops recognising speech by user, when the same
behavior fails in the app. In order to make it work I have to restart the
device.

Any ideas on what could be wrong and how to resolve it?

-- 
Thanks,

Devarshi
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to