> For the complete documentation index, see [llms.txt](https://kazescripts.gitbook.io/kazescripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kazescripts.gitbook.io/kazescripts/kaze_sound/configuration.md).

# Configuration

Every option in config.lua, with its default value.

All settings live in `kaze_sound/config.lua`. Restart the resource after changing them.

## General

| Option                   | Default            | Description                                                                                                                                                                         |
| ------------------------ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Debug`           | `false`            | Enables test commands, on-screen labels and console logging.                                                                                                                        |
| `Config.AdminAce`        | `'command.ksound'` | Ace permission needed for the synced test command `/ksound_sync`.                                                                                                                   |
| `Config.UpdateInterval`  | `33`               | Milliseconds between position updates. The engine smooths between updates, so 30–50 is plenty.                                                                                      |
| `Config.ListenerMode`    | `'camera'`         | `'camera'` hears from the game camera, like GTA's own audio. `'ped'` hears from the character's head.                                                                               |
| `Config.Panning`         | `'stereo'`         | `'stereo'`: a sound on your right plays in the right ear only, and sounds behind you are duller. `'HRTF'`: binaural 3D with softer left/right and up/down cues, best on headphones. |
| `Config.MasterVolume`    | `1.0`              | Default volume multiplier for new players. Players change their own with `/soundvolume`.                                                                                            |
| `Config.MuteInPauseMenu` | `true`             | Mutes all sounds while the pause menu is open.                                                                                                                                      |

## Sound defaults

`Config.Defaults` holds the value every sound uses unless your script overrides it in `Play()`.

| Option         | Default  | Description                                                                                               |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| `volume`       | `0.5`    | 0.0 to 1.0.                                                                                               |
| `maxDistance`  | `30.0`   | Metres. The sound is silent beyond this range.                                                            |
| `refDistance`  | `3.0`    | Metres. Full volume inside this radius.                                                                   |
| `rolloff`      | `1.2`    | How fast volume drops after `refDistance`. Higher is faster.                                              |
| `loop`         | `false`  | Repeat the track.                                                                                         |
| `spatial`      | `true`   | `false` plays a plain 2D sound (UI, phone, notifications).                                                |
| `occlusion`    | `true`   | Walls, interiors and car cabins muffle the sound.                                                         |
| `reverb`       | `true`   | Room reverb on or off.                                                                                    |
| `reverbPreset` | `'auto'` | Room sound. See [Surround and acoustics](/kazescripts/kaze_sound/surround-and-acoustics.md#room-presets). |
| `reverbAmount` | `1.0`    | Multiplier on the preset's reverb.                                                                        |
| `doppler`      | `false`  | Pitch shift from relative speed. Good for sirens, odd on music.                                           |
| `autoDestroy`  | `true`   | Remove the sound when a non-looped track ends.                                                            |

## Occlusion

`Config.Occlusion` controls muffling. Values run from 0.0 (no effect) to 1.0 (fully muffled).

| Option            | Default   | Description                                                                                                          |
| ----------------- | --------- | -------------------------------------------------------------------------------------------------------------------- |
| `enabled`         | `true`    | Master switch for all muffling.                                                                                      |
| `raycast`         | `true`    | Check for walls and objects between the camera and the source.                                                       |
| `raycastInterval` | `250`     | Milliseconds between wall checks, per sound.                                                                         |
| `raycastFlags`    | `1 \| 16` | What the wall check hits: world geometry and objects.                                                                |
| `wallAmount`      | `0.45`    | Muffling from a wall in the way.                                                                                     |
| `sourceClearance` | `1.5`     | Metres around the source ignored by the wall check, so a speaker prop or the wall it hangs on doesn't muffle itself. |
| `interiorAmount`  | `0.55`    | Muffling when you and the source are in different interiors (or one inside, one outside).                            |
| `vehicleCabin`    | `0.70`    | Muffling from a closed car cabin.                                                                                    |
| `perOpenWindow`   | `0.10`    | Cabin muffling removed per open or smashed window.                                                                   |
| `perOpenDoor`     | `0.18`    | Cabin muffling removed per open door. The trunk counts half.                                                         |
| `minCutoff`       | `320`     | Hz. Highest frequency left at full muffling. Lower means more "bass through the wall".                               |
| `maxGainLoss`     | `0.55`    | Volume lost at full muffling.                                                                                        |

## Reverb

`Config.Reverb` controls room acoustics.

| Option         | Default            | Description                                                                                         |
| -------------- | ------------------ | --------------------------------------------------------------------------------------------------- |
| `enabled`      | `true`             | Master switch for reverb.                                                                           |
| `distanceWet`  | `0.18`             | Extra reverb as the source gets further away.                                                       |
| `outsideBoost` | `1.35`             | Reverb multiplier when you're outside the source's room. You mostly hear the room boom leaking out. |
| `auto`         | `room` / `outdoor` | Presets used by `reverbPreset = 'auto'` indoors and outdoors.                                       |
| `presets`      | 10 presets         | The room definitions. See below.                                                                    |

Each preset accepts these fields:

| Field            | Meaning                                                                                          |
| ---------------- | ------------------------------------------------------------------------------------------------ |
| `wet`            | Reverb mix, 0 to 1.                                                                              |
| `decay`          | Echo tail length in seconds.                                                                     |
| `preDelay`       | Seconds before the echo starts. Bigger means a bigger room.                                      |
| `damping`        | 0 for hard, bright walls (concrete, tiles) to 1 for soft, dark rooms (carpet, crowd).            |
| `early`          | Number of early wall reflections.                                                                |
| `lowCut`         | Hz. Removes mud from the echo.                                                                   |
| `bass`, `treble` | dB tone shaping applied to the sound itself. `club` uses `bass = 6.0` for the sound-system boom. |

You can edit the existing presets or add your own, then use them by name with `reverbPreset`.

## Doppler

| Option                    | Default | Description                                      |
| ------------------------- | ------- | ------------------------------------------------ |
| `Config.Doppler.factor`   | `1.0`   | Strength of the pitch shift.                     |
| `Config.Doppler.maxShift` | `0.25`  | Maximum speed-up or slow-down of playback (25%). |
