Class

SFSpeechAudioBufferRecognitionRequest

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

Declaration

@interface SFSpeechAudioBufferRecognitionRequest : SFSpeechRecognitionRequest

Overview

Use an SFSpeechAudioBufferRecognitionRequest object to perform speech recognition on live audio, or on a set of existing audio buffers. For example, use this request object to route audio from a device's microphone to the speech recognizer.

The request object contains no audio initially. As you capture audio, call appendAudioPCMBuffer: or appendAudioSampleBuffer: to add audio samples to the request object. The speech recognizer continuously analyzes the audio you appended, stopping only when you call the endAudio method. (You must call endAudio explicitly to stop the speech recognition process.)

For a complete example of how to use audio buffers with speech recognition, see SpeakToMe: Using Speech Recognition with AVAudioEngine.

Topics

Appending Audio Buffers

- appendAudioPCMBuffer:

Appends audio in the PCM format to the end of the recognition request.

- appendAudioSampleBuffer:

Appends audio to the end of the recognition request.

- endAudio

Marks the end of audio input for the recognition request.

Getting the Audio Format

nativeAudioFormat

The preferred audio format for optimal speech recognition.

Relationships

See Also

Audio Sources

Recognizing Speech in Live Audio

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

SFSpeechURLRecognitionRequest

A request to recognize speech in a recorded audio file.

SFSpeechRecognitionRequest

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software