<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Audio/GeneratorRenderHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation5AudioO22GeneratorRenderHandlera"
  },
  "title" : "Audio.GeneratorRenderHandler"
}
-->

# Audio.GeneratorRenderHandler

A handler that generates real-time audio.

```
typealias GeneratorRenderHandler = AVAudioSourceNodeRenderBlock
```

## Discussion

The audio format is `Float32` with a sample rate of `48000`.

> Note: The system executes your handler in a real-time audio thread.
> Achieve optimal performance by ensuring the closure finishes quickly.
> Avoid heap allocations or locks within the closure.

> Note: As of Swift 6, you should mark your handler as @Sendable to ensure no
> actor isolation is inferred and that any captured values are
> safe to use from a realtime audio concurrency domain.

---

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)