Instance Property

frameLength

The current number of valid sample frames in the buffer.

Declaration

var frameLength: AVAudioFrameCount { get set }

Discussion

By default, the frameLength property is not initialized to a useful value; you must set this property before using the buffer. The length must be less than or equal to the frameCapacity of the buffer. In the case of deinterleaved formats, frameCapacity refers to the size of one channel’s worth of audio samples.

You may modify the length of the buffer as part of an operation that modifies its contents. Modifying frameLength updates the mDataByteSize field in each of the underlying AudioBufferList struct’s AudioBuffer struct correspondingly, and vice versa.

See Also