---
title: "withMagicCookie(_:)"
framework: coremedia
role: symbol
role_heading: Instance Method
path: "coremedia/cmformatdescription/withmagiccookie(_:)"
---

# withMagicCookie(_:)

Returns the magic cookie.

## Declaration

```swift
func withMagicCookie<R>(_ body: (UnsafeRawBufferPointer?) throws -> R) rethrows -> R
```

## Parameters

- `body`: A pointer to the magic cookie in the audio format description.
