<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioPCMBuffer/frameLength",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioPCMBuffer(py)frameLength"
  },
  "title" : "frameLength"
}
-->

# frameLength

The current number of valid sample frames in the buffer.

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

## 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`](/documentation/AVFAudio/AVAudioPCMBuffer/frameCapacity) of the buffer. For deinterleaved formats, [`frameCapacity`](/documentation/AVFAudio/AVAudioPCMBuffer/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 <doc://com.apple.documentation/documentation/CoreAudioTypes/AudioBufferList> structure’s `AudioBuffer` properties correspondingly, and vice versa.

## See Also

[`frameCapacity`](/documentation/AVFAudio/AVAudioPCMBuffer/frameCapacity)

The buffer’s capacity, in audio sample frames.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)