---
title: frameLength
framework: avfaudio
role: symbol
role_heading: Instance Property
path: avfaudio/avaudiopcmbuffer/framelength
---

# frameLength

The current number of valid sample frames in the buffer.

## Declaration

```swift
var frameLength: AVAudioFrameCount { get set }
```

## Discussion

Discussion By default, the frameLength property doesn’t have a useful value upon creation, so you must set this property before using the buffer. The length must be less than or equal to the frameCapacity of the buffer. For 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 structure’s AudioBuffer properties correspondingly, and vice versa.

## See Also

### Related Documentation

- [frameCapacity](avfaudio/avaudiopcmbuffer/framecapacity.md)
