---
title: "read(into:frameCount:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudiofile/read(into:framecount:)"
---

# read(into:frameCount:)

Reads a portion of an audio buffer using the number of frames you specify.

## Declaration

```swift
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.

## Discussion

Discussion You use this method to read fewer frames than the buffer’s frameCapacity.

## See Also

### Reading and Writing the Audio Buffer

- [read(into:)](avfaudio/avaudiofile/read(into:).md)
- [read(frameCount:)](avfaudio/avaudiofile/read(framecount:).md)
- [close()](avfaudio/avaudiofile/close().md)
