# 🧱 5. Advanced Features

#### Asynchronous Raycast Occlusion

The package includes a highly optimized, multi-threaded occlusion system. It uses Unity's `RaycastCommand` to check for obstacles between the listener and the sound source.

* **Time-Slicing:** Rays are cast every N frames (configurable in Project Settings) to save physics CPU time.
* **Smooth Interpolation:** When an object goes behind a wall, the occlusion parameter is smoothly interpolated, preventing harsh audio popping.

#### Smart Culling & Virtualization

Audio Dispatcher uses **FMOD Studio as the Single Source of Truth**.\
It automatically reads the `MaxDistance` of your events from the FMOD banks.

* **One-Shots:** If a one-shot is spawned further than its `MaxDistance`, the command is dropped. FMOD never even hears about it.
* **Loops:** If a looping entity moves out of range, the system calls `EventSetPaused(true)`. This instantly frees up the hardware channel (Voice Stealing) and stops sending 3D matrices, saving massive amounts of CPU. When the entity comes back into range, it seamlessly resumes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sniveler-code.gitbook.io/dots/audio-dispatcher-fmod/5.-advanced-features.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
