One Logo Pool Ball
Speech · IOS API REFERENCE

AnalyzerInput

struct · iOS 26.0+ · SDK 27.1

struct AnalyzerInput

Time-coded audio data. The audio data must have an audio format that is supported by the analyzer's modules; the analyzer does not perform audio conversion. Call ``SpeechAnalyzer/bestAvailableAudioFormat(compatibleWith:considering:)-([SpeechModule],_)`` (or its variants) to select an appropriate format to convert to. The audio format may differ from one `AnalyzerInput` object to the next. If the new audio format is supported by the modules, the modules will be reconfigured as needed.

Members (7)

get · iOS 27.0+

bufferFormat

TypeScript
get bufferFormat(): _AVFAudio_AVAudioFormat
Swift declaration
let bufferFormat: AVAudioFormat

The audio format of this input.

get · iOS 27.0+

bufferDuration

TypeScript
get bufferDuration(): _CoreMedia_CMTime
Swift declaration
let bufferDuration: CMTime

The length of this input.

get · iOS 26.0+

bufferStartTime

TypeScript
get bufferStartTime(): (_CoreMedia_CMTime) | null
Swift declaration
let bufferStartTime: CMTime?

The time-code of this input.

init · iOS 26.0+

init

TypeScript
static initBufferBufferStartTime(buffer: _AVFAudio_AVAudioPCMBuffer, bufferStartTime?: (_CoreMedia_CMTime) | null): AnalyzerInput
Swift declaration
init(buffer: AVAudioPCMBuffer, bufferStartTime: CMTime?)

Creates an audio input object for audio that may be discontiguous with previous input. The audio buffer must not overlap or precede other audio input, as determined by the `bufferStartTime` value. - Important: If the buffer is converted from other differently-formatted audio, ensure that the buffer's start time is accurate. Some conversion algorithms can use a "priming" method that may shift some audio to a later converted buffer. This shift will misalign the original and converted audio buffers; the original buffer's start time would not be usable as the `bufferStartTime` value for the converted buffer. - Tip: Convert an `AVAudioTime` instance to a `CMTime` instance with this code. ```swift CMTime(value: avAudioTime.sampleTime, timescale: CMTimeScale(avAudioTime.sampleRate)) ``` - Parameters: - buffer: An audio buffer. - bufferStartTime: The time-code of the start of the audio buffer. If `nil`, this audio buffer is assumed to start immediately after the previous buffer (or at time-code zero if there is no previous buffer). The `CMTime` can have a different timescale than the sample rate of the audio data.

init · iOS 27.0+

init

TypeScript
static initBuffer(buffer: _CoreMedia_CMReadySampleBuffer<_CoreMedia_CMReadOnlyDataBlockBuffer>): AnalyzerInput
Swift declaration
init(buffer: CMReadySampleBuffer<CMReadOnlyDataBlockBuffer>)

Creates an audio input object. The audio buffer must not overlap or precede other audio input, as determined by the buffer's `presentationTimeStamp` value. - Tip: To convert a `CMSampleBuffer` to a `CMReadySampleBuffer`, use `CMReadySampleBuffer(unsafeWithDataBuffer:)`. You should not alter the original `CMSampleBuffer` after passing it to that initializer. - Parameters: - buffer: An audio buffer.

init · iOS 26.0+

init

TypeScript
static initBuffer73090(buffer: _AVFAudio_AVAudioPCMBuffer): AnalyzerInput
Swift declaration
init(buffer: AVAudioPCMBuffer)

Creates an audio input object. This audio buffer is assumed to start immediately after the previous buffer (or at time-code zero if there is no previous buffer). - Parameters: - buffer: An audio buffer.

get · iOS 26.0+ · Deprecated in iOS 27.0

buffer

TypeScript
get buffer(): _AVFAudio_AVAudioPCMBuffer
Swift declaration
var buffer: AVAudioPCMBuffer { get }

A new copy of the audio data for this input.

Skipped declarations

No declarations were skipped in this snapshot.

All Speech types →