One Logo Pool Ball
Speech · IOS API REFERENCE

AnalyzerInputConverter

class · iOS 27.0+ · SDK 27.1

final class AnalyzerInputConverter

Converts audio buffers to a format suitable for analysis by a speech analyzer.

Members (4)

init · iOS 27.0+

init

TypeScript
static init(analyzerFormat: _AVFAudio_AVAudioFormat, configurationHandler?: (((arg0: _AVFAudio_AVAudioConverter) => void)) | null): AnalyzerInputConverter
Swift declaration
init(analyzerFormat: AVAudioFormat, configurationHandler: ((AVAudioConverter) -> Void)? = nil)

Creates an audio input converter. - Parameters: - analyzerFormat: The audio format to convert the audio samples to. The audio format should be one supported by the speech analyzer's modules. - configurationHandler: A closure called to customize the instances of `AVAudioConverter` that this converter creates as needed. The closure takes the following parameter: - term audioConverter: A newly-created instance of `AVAudioConverter`.

method · iOS 27.0+

flush

TypeScript
flush(): Array<AnalyzerInput>
Swift declaration
final func flush() throws -> [AnalyzerInput]

Completes pending audio conversions. - Returns: An array of `AnalyzerInput` objects containing completed pending audio conversions.

method · iOS 27.0+

convert

TypeScript
convert(buffer: _AVFAudio_AVAudioBuffer, audioTime?: (_AVFAudio_AVAudioTime) | null): Array<AnalyzerInput>
Swift declaration
final func convert(_ buffer: AVAudioBuffer, at audioTime: AVAudioTime?) throws -> [AnalyzerInput]

Converts an audio buffer. This method does not necessarily convert the entire audio buffer. Some audio data may be held over and integrated into the conversion of a later audio buffer for correctness or efficiency. Call ``flush()`` to convert any remaining held-over audio and add it to the analyzer's input sequence before finishing the sequence. - Parameters: - buffer: An audio buffer to convert. Do not reuse or modify this buffer; it may be retained across calls. - audioTime: The time-code of the start of the audio buffer. If `nil`, the audio buffer is assumed to start immediately after the previous buffer (or at time-code zero if there is no previous buffer). - Returns: An array of `AnalyzerInput` objects containing converted audio corresponding to some or all of the audio buffer.

static · iOS 27.0+

converter

TypeScript
static converter(modules: Array<SDKHandle>): Promise<AnalyzerInputConverter>
Swift declaration
static func converter(compatibleWith modules: [any SpeechModule]) async throws -> AnalyzerInputConverter

Returns an audio input converter compatible with the given modules. - Parameter modules: The speech modules that will analyze the audio. - Returns: An instance of this class.

Skipped declarations

No declarations were skipped in this snapshot.

All Speech types →