xamarin.iosofflinetranscriptionsfspeechrecognizer

SFSpeechRecognitionRequest on Xamarin.iOS requiresOnDeviceRecognition. Is it available?


I am using this article which also has a sample for Speech recognition in Xamarin.iOS using Apple's SFSpeechRecognition

https://learn.microsoft.com/en-us/xamarin/ios/platform/speech?tabs=macos

The sample works fine but it doesn't work without internet. There is an option in iOS 13 and above of a boolean value requiresOnDeviceRecognition which if set to true, it will do offline transcription according to their documentation.

The problem is that, i am not seeing this option anywhere in the Xamarin.iOS documentation. https://developer.apple.com/documentation/speech/sfspeechrecognitionrequest/3152603-requiresondevicerecognition?language=objc

Can someone please guide me to that?


Solution

  • There is no such property in the documentation, but if you write the code such property is available:

            var request = new SFSpeechUrlRecognitionRequest(new NSUrl("path", false));
            request.RequiresOnDeviceRecognition = true;