Contents

convert(to:error:withInputFrom:)

Performs a conversion between audio formats, if the system supports it.

Declaration

func convert(to outputBuffer: AVAudioBuffer, error outError: NSErrorPointer, withInputFrom inputBlock: @escaping  AVAudioConverterInputBlock) -> AVAudioConverterOutputStatus

Parameters

  • outputBuffer:

    The output audio buffer.

  • outError:

    The error if the conversion fails.

  • inputBlock:

    A block the framework calls to get input data.

Return Value

An AVAudioConverterOutputStatus type that indicates the conversion status.

Discussion

The method attempts to fill the buffer to its capacity. On return, the buffer’s length indicates the number of sample frames the framework successfully converts.

Topics

Callbacks

See Also

Converting Audio Formats