Class

SFSpeechRecognizer

A supported speech recognizer.

Overview

A speech recognizer recognizes only one language. When you use the default initializer, you get a speech recognizer for the device's current locale, if a recognizer is supported for that locale. Note that a supported speech recognizer is not the same as an available speech recognizer; for example, the recognizers for some locales may require an Internet connection. You can use the supportedLocales() method to get a list of supported locales and the isAvailable property to find out if the recognizer for a specific locale is available.

Symbols

Getting the User's Permission

class func requestAuthorization((SFSpeechRecognizerAuthorizationStatus) -> Void)

Asks the user to grant your app permission to perform speech recognition.

class func authorizationStatus()

Returns the status of the authorization request to perform speech recognition.

Creating a Speech Recognizer and Setting the Delegate

init?()

Creates a speech recognizer for the device's current locale, if supported.

init?(locale: Locale)

Creates a speech recognizer for the specified locale, if supported.

var delegate: SFSpeechRecognizerDelegate?

The delegate for the speech recognizer.

Performing a Speech Recognition Task

func recognitionTask(with: SFSpeechRecognitionRequest, delegate: SFSpeechRecognitionTaskDelegate)

Recognizes speech from the audio source associated with the specified request, using the specified delegate to manage the results.

func recognitionTask(with: SFSpeechRecognitionRequest, resultHandler: (SFSpeechRecognitionResult?, Error?) -> Void)

Recognizes speech from the audio source associated with the specified request, using the specified completion handler to handle the results.

var defaultTaskHint: SFSpeechRecognitionTaskHint

A hint that indicates the type of speech recognition being requested.

Getting Information About a Recognizer

var isAvailable: Bool

A Boolean value that indicates whether the speech recognizer is available.

var locale: Locale

The locale of the speech recognizer.

class func supportedLocales()

Returns a set of locales that support speech recognition.

var queue: OperationQueue

The queue used by the speech recognizer for recognition task handlers and delegate messages.

Relationships

Inherits From

Conforms To