<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AudioFileGetUserDataAtOffset(_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@F@AudioFileGetUserDataAtOffset"
  },
  "title" : "AudioFileGetUserDataAtOffset(_:_:_:_:_:_:)"
}
-->

# AudioFileGetUserDataAtOffset(_:_:_:_:_:_:)

Gets part of the data from a chunk in an audio file.

```
func AudioFileGetUserDataAtOffset(_ inAudioFile: AudioFileID, _ inUserDataID: UInt32, _ inIndex: UInt32, _ inOffset: Int64, _ ioUserDataSize: UnsafeMutablePointer<UInt32>, _ outUserData: UnsafeMutableRawPointer) -> OSStatus
```

## Parameters

`inAudioFile`

The audio file whose chunk you want to get data from.

`inUserDataID`

The four-character code of the designated chunk.

`inIndex`

An index that specifies which chunk with the four-character code specified in the `inUserDataID` parameter you want to query.

`inOffset`

An offset from the first byte of the chunk to the first byte to get.

`ioUserDataSize`

On input, a pointer to the size of the buffer that contains the designated chunk. On output, a pointer to the size of bytes that the system copied to the buffer.

`outUserData`

A pointer to a buffer in which to copy the chunk data.

## Return Value

A result code if there’s an error (see Result Codes) or `noErr` if the operation succeeds.

## Discussion

See [`AudioFileGetUserDataSize64(_:_:_:_:)`](/documentation/AudioToolbox/AudioFileGetUserDataSize64(_:_:_:_:)) for an example of using this function to parse the Audio Definition Model (ADM) of a BW64 file, which is 64-bit and based on WAVE.

---

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)