<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AUAudioUnit/token(byAddingRenderObserver:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:objc(cs)AUAudioUnit(im)tokenByAddingRenderObserver:"
  },
  "title" : "token(byAddingRenderObserver:)"
}
-->

# token(byAddingRenderObserver:)

Adds a block to be called on each render cycle.

```
func token(byAddingRenderObserver observer: @escaping AURenderObserver) -> Int
```

## Parameters

`observer`

The block to call.

## Return Value

A token to be used when removing the observer.

## Discussion

The supplied block is called at the beginning and ending of each render cycle. It should not make any blocking calls.

This method is implemented in the [`AUAudioUnit`](/documentation/AudioToolbox/AUAudioUnit) base class and should not be overridden.

This version 3 method is bridged to the version 2 [`AudioUnitAddRenderNotify(_:_:_:)`](/documentation/AudioToolbox/AudioUnitAddRenderNotify(_:_:_:)) API.

---

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)