> 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/installation.md).

# Installation

Install kaze\_sound and check that surround sound works.

{% stepper %}
{% step %}

### Add the resource

Download kaze\_sound from the Cfx.re Portal and place the `kaze_sound` folder in your `resources` directory. See [Installing your assets](/kazescripts/installing-your-assets.md) if this is your first KazeScripts purchase.
{% endstep %}

{% step %}

### Start it before your other scripts

In `server.cfg`, ensure kaze\_sound **before** any resource that plays sounds or uses voice through it:

```cfg
setr voice_useNativeAudio true

ensure kaze_sound

# scripts that use kaze_sound come after
ensure my_radio_script
```

{% hint style="warning" %}
**Using pma-voice?** kaze\_sound includes voice chat and replaces it. Stop pma-voice before starting kaze\_sound. See [Migrating from pma-voice](/kazescripts/kaze_sound/migrating-from-pma-voice.md). To keep another voice system instead, set `Config.Voice.enabled = false` in `config_voice.lua`.
{% endhint %}
{% endstep %}

{% step %}

### Restart the server

kaze\_sound needs no database and no framework. Once the server is up, the audio engine and voice chat load automatically for every player.
{% endstep %}

{% step %}

### Test it in game (optional)

Set `Config.Debug = true` in `config.lua`, restart the resource, and run these commands in the F8 console:

| Command             | What to check                                                                      |
| ------------------- | ---------------------------------------------------------------------------------- |
| `/ksound_orbit`     | A sound circles you: right, behind, left, in front. Confirms surround works.       |
| `/ksound_here club` | A looping beat at your position with the club preset. Walk away and behind a wall. |
| `/ksound_car`       | Turns your vehicle into a radio. Get out, close the doors, then open one.          |
| `/ksound_stop`      | Stops every test sound.                                                            |

For voice, talk with a second player, press the key under Esc to change range, and walk behind a wall. Set `Config.Debug` back to `false` when you're done. The full command list is on [Commands and debugging](/kazescripts/kaze_sound/commands-and-debugging.md).
{% endstep %}
{% endstepper %}

## Adding your own audio files

Put audio files (mp3, ogg, wav, m4a) in `kaze_sound/sounds/` and play them with a `nui://` link:

```lua
exports.kaze_sound:Play({ url = 'nui://kaze_sound/sounds/my_song.mp3', coords = vec3(0.0, 0.0, 70.0) })
```

Files you ship this way always get full surround. Every player downloads them when they join, so keep large music libraries on a web host instead. See [Audio sources](/kazescripts/kaze_sound/audio-sources.md).

{% hint style="info" %}
Files in `sounds/` are picked up on resource start. After adding files, restart kaze\_sound.
{% endhint %}
