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

# AudioFileStreamSeek(_:_:_:_:)

Provides a byte offset for a specified packet in the data stream.

```
func AudioFileStreamSeek(_ inAudioFileStream: AudioFileStreamID, _ inPacketOffset: Int64, _ outDataByteOffset: UnsafeMutablePointer<Int64>, _ ioFlags: UnsafeMutablePointer<AudioFileStreamSeekFlags>) -> OSStatus
```

## Parameters

`inAudioFileStream`

The ID of the parser to which you wish to provide a byte offset. The parser ID is returned by the [`AudioFileStreamOpen(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioFileStreamOpen(_:_:_:_:_:)) function.

`inPacketOffset`

The number of packets from the beginning of the file of the packet whose byte offset you wish to have returned.

`outDataByteOffset`

On output, the absolute byte offset of the packet whose offset you specify in the `inPacketOffset` parameter. For audio file formats that do not contain packet tables, the returned offset may be an estimate.

`ioFlags`

On output, if the `outDataByteOffset` parameter returns an estimate, this parameter returns the constant `kAudioFileStreamSeekFlag_OffsetIsEstimated`. Currently, no input flags are defined for this call.

## Return Value

A result code. See Result Codes.

## Discussion

After you call this function, the parser assumes the next data passed to the [`AudioFileStreamParseBytes(_:_:_:_:)`](/documentation/AudioToolbox/AudioFileStreamParseBytes(_:_:_:_:)) function starts from the byte offset returned in the `outDataByteOffset` parameter.

## See Also

[`AudioFileStreamParseBytes(_:_:_:_:)`](/documentation/AudioToolbox/AudioFileStreamParseBytes(_:_:_:_:))

Passes audio file stream data to the parser.

[`AudioFileStreamOpen(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioFileStreamOpen(_:_:_:_:_:))

Creates and opens a new audio file stream parser.



---

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)