Instance Method

read(into:)

Read an entire buffer.

Declaration

func read(into buffer: AVAudioPCMBuffer) throws

Parameters

buffer

The buffer from which to read the file. Its format must match the file’s processing format.

outError

Returns, by-reference, a description of the error, if an error occurs.

Return Value

true, if the read was successful; otherwise false.

Discussion

Reading sequentially from the framePosition property, attempts to fill the buffer to its capacity. On return, the buffer’s length property indicates the number of sample frames successfully read.

See Also

Reading and Writing the Audio Buffer