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


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 a similar behavior, except that you can use it without the presence of the keyboard. For example, you might use speech recognition to 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.



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 given speech it its entirety, as recognized by the speech recognizer.

class SFTranscriptionSegment

A discrete part of an entire transcription, as identified by the speech recognizer.