Contents

init(forReading:commonFormat:interleaved:)

Opens a file for reading using the specified processing format.

Declaration

init(forReading fileURL: URL, commonFormat format: AVAudioCommonFormat, interleaved: Bool) throws

Parameters

  • fileURL:

    The file to read.

  • format:

    The processing format to use when reading from the file.

  • interleaved:

    The Boolean value that indicates whether to use an interleaved processing format.

Return Value

A new AVAudioFile instance you use for reading.

Discussion

The processing format refers to the buffers it reads from the file. The system reads the content and converts from the file format to the processing format. The processing format must be at the same sample rate as the actual file contents, and must be linear PCM. The interleaved parameter determines whether the processing buffer is in an interleaved float format.

See Also

Creating an Audio File