Framework

Speech

Perform speech recognition on live or prerecorded audio, and receive transcriptions, alternative interpretations, and confidence levels of the results.

Overview

Use the Speech framework to recognize spoken words in recorded or live audio. The keyboard's dictation support uses speech recognition to translate audio content into text; this framework provides similar behavior, except that you can use it without the presence of the keyboard. For example, you might use speech recognition to handle recognize verbal commands or handle text dictation in other parts of your app.

You can perform speech recognition in many languages, but each SFSpeechRecognizer object operates on a single language. On-device speech recognition is available for some languages, but the framework also relies on Apple's servers for speech recognition. Always assume that performing speech recognition requires a network connection.

Topics

Required Steps

Asking Permission to Use Speech Recognition

Ask the user's permission to perform speech recognition using Apple's servers.

class SFSpeechRecognizer

An object you use to check for the availability of the speech recognition service, and to initiate the speech recognition process.

Audio Sources

Recognizing Speech in Live Audio

Perform speech recognition on audio coming from the microphone of an iOS device.

class SFSpeechURLRecognitionRequest

A request to recognize speech in a recorded audio file.

class SFSpeechAudioBufferRecognitionRequest

A request to recognize speech from captured audio content, such as audio from the device's microphone.

class SFSpeechRecognitionRequest

An abstract class representing a request to recognize speech from an audio source.

In-Progress Requests

class SFSpeechRecognitionTask

A task object that you use to monitor the speech recognition progress.

Transcription Results

class SFSpeechRecognitionResult

An object containing the partial or final results of a speech recognition request.

class SFTranscription

A textual representation of the recognized speech.

class SFTranscriptionSegment

A part of the entire hypothesized transcription.

Property List Keys

Property List Key NSSpeechRecognitionUsageDescription

A message that tells the user why the app is requesting to send user data to Apple’s speech recognition servers.