Protocol

SFSpeechRecognitionTaskDelegate

A protocol that supports complex or multi-utterance speech recognition requests.

Overview

You can implement the optional methods defined by this protocol if you need fine-grained control over complex speech recognition tasks. For example, you can use speechRecognitionDidDetectSpeech(_:) to find out when the task first detects speech in the source audio and speechRecognitionTaskFinishedReadingAudio(_:) to find out when the task is no longer accepting audio and may be finishing processing.

Topics

Beginning a Speech Recognition Task

func speechRecognitionDidDetectSpeech(SFSpeechRecognitionTask)

Tells the delegate when the task first detects speech in the source audio.

Finishing a Speech Recognition Task

func speechRecognitionTask(SFSpeechRecognitionTask, didFinishSuccessfully: Bool)

Tells the delegate when the recognition of all requested utterances is finished.

func speechRecognitionTaskFinishedReadingAudio(SFSpeechRecognitionTask)

Tells the delegate when the task is no longer accepting new audio input, even if final processing is in progress.

func speechRecognitionTaskWasCancelled(SFSpeechRecognitionTask)

Tells the delegate that the task has been canceled.

Getting a Transcription

func speechRecognitionTask(SFSpeechRecognitionTask, didHypothesizeTranscription: SFTranscription)

Tells the delegate that a hypothesized transcription is available.

Relationships

Inherits From

See Also

Working with Recognition Results and Transcriptions

class SFSpeechRecognitionResult

A recognized utterance that corresponds to a segment of recorded speech and that contains one or more transcription hypotheses.

class SFTranscription

A hypothesized textual representation of recognized speech.

class SFTranscriptionSegment

A part of the entire hypothesized transcription.

protocol SFSpeechRecognizerDelegate

A protocol that helps you track the availability of a speech recognizer.