---
title: "convert(_:at:)"
framework: speech
role: symbol
role_heading: Instance Method
path: "speech/analyzerinputconverter/convert(_:at:)"
---

# convert(_:at:)

Converts an audio buffer.

## Declaration

```swift
final func convert(_ buffer: AVAudioBuffer, at audioTime: AVAudioTime?) throws -> [AnalyzerInput]
```

## 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).

## Return Value

Return Value An array of AnalyzerInput objects containing converted audio corresponding to some or all of the audio buffer.

## Discussion

Discussion 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.

## See Also

### Converting a buffer

- [flush()](speech/analyzerinputconverter/flush().md)
