---
title: AudioFileStream_PacketsProc
framework: audiotoolbox
role: symbol
role_heading: Type Alias
path: audiotoolbox/audiofilestream_packetsproc
---

# AudioFileStream_PacketsProc

Invoked by an audio file stream parser when it finds audio data in the audio file stream.

## Declaration

```swift
typealias AudioFileStream_PacketsProc = (UnsafeMutableRawPointer, UInt32, UInt32, UnsafeRawPointer, UnsafeMutablePointer<AudioStreamPacketDescription>?) -> Void
```

## Parameters

- `inClientData`: The value you provided in the inClientData parameter when you called the doc://com.apple.audiotoolbox/documentation/AudioToolbox/AudioFileStreamOpen(_:_:_:_:_:) function.
- `inNumberBytes`: The number of bytes of data in the inInputData buffer.
- `inNumberPackets`: The number of packets of audio data in the inInputData buffer.
- `inInputData`: The audio data.
- `inPacketDescriptions`: An array of audio file stream packet description structures describing the data. Audio file stream packet description structures are described in doc://com.apple.documentation/documentation/CoreAudio/core-audio-data-types.

## Discussion

Discussion If you named your function MyAudioFileStream_PacketsProc, you would declare it like this: Discussion For constant-bit-rate (CBR) audio data, your callback is typically called with as much data as you passed to the AudioFileStreamParseBytes(_:_:_:_:) function. At times, however, only a single packet might be passed because of boundaries in the input data. For variable-bit-rate (VBR) audio data, your callback might be called several times for each time you called the AudioFileStreamParseBytes(_:_:_:_:) function.

## See Also

### Callbacks

- [AudioFileStream_PropertyListenerProc](audiotoolbox/audiofilestream_propertylistenerproc.md)
