Instance Method

read(into:frameCount:)

Read a portion of a buffer.

Declaration

func read(into buffer: AVAudioPCMBuffer, frameCount frames: AVAudioFrameCount) throws

Parameters

buffer

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

frames

The number of frames to read.

outError

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

Return Value

true, if the read was successful; otherwise false.

Discussion

Like the read:error: method, but can be used to read fewer frames than the buffer frameCapacity.

See Also

Reading and Writing the Audio Buffer