> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_casino/features/editor/ambient-sounds.md).

# Ambient Sounds

Managing Ambient Sounds in the Casino Editor

The Ambient Sounds editor page places looping audio in the world: casino floor noise, music in a lounge, machine hum in a back room. Each sound plays from a fixed position and fades with distance, and can be limited to specific interiors.

### Editor Settings

<table data-full-width="false"><thead><tr><th>Setting</th><th>Info</th></tr></thead><tbody><tr><td>Name</td><td>Choose a display name for the ambient sound</td></tr><tr><td>Sound URL</td><td>The audio file to play: a path inside the resource, or a full URL</td></tr><tr><td>Volume</td><td>Playback volume, <code>0.0</code> to <code>1.0</code></td></tr><tr><td>Position</td><td>Where the sound plays from</td></tr><tr><td>Copy Current Position</td><td>Move the sound to where you are standing</td></tr><tr><td>Interior IDs</td><td>Comma-separated interior ids the sound is allowed to play in</td></tr><tr><td>Append Current Interior ID</td><td>Detect the interior you are in and add it to the list</td></tr><tr><td>Proximity</td><td>How far away the sound can be heard, in meters</td></tr><tr><td>Load Only Inside Interiors</td><td>Load this sound only while players are in interiors</td></tr><tr><td>Add Ambient Sound</td><td>Create a new sound at the current position</td></tr><tr><td>Delete</td><td>Delete the selected sound</td></tr></tbody></table>

## Sound files

`soundUrl` accepts either:

* A path inside the resource, for example `client/html/sounds/interior.mp3`. Drop your file in that folder and reference it relatively. This is the reliable option, since the file is part of the resource.
* A full URL, streamed from the web.

{% hint style="warning" %}
A remote URL depends on that host staying up and reachable from every player's game. If it goes down, the sound silently stops working for everyone. Prefer a local file for anything you care about.
{% endhint %}

## Example config

Ambient sounds live in `configs/interior/ambientsound.lua` in the `AmbientSounds` table, though you would normally create them in the editor rather than by hand.

```lua
AmbientSounds = {
    ["casino"] = {
        name = "Casino",
        interiorId = 121858,      -- single interior id (kept for backwards compatibility)
        interiorIds = { 121858 }, -- one or more interior ids the sound plays in
        coords = vec3(928.322327, 31.574055, 73.858025),
        soundUrl = "client/html/sounds/interior.mp3",
        soundVolume = 0.5,
        proximity = 50.0,
        loadInInterior = true,
    }
}
```

<table data-full-width="false"><thead><tr><th width="200">Field</th><th>Info</th></tr></thead><tbody><tr><td><code>interiorIds</code></td><td>The list the resource actually uses. A sound only plays for players inside one of these interiors.</td></tr><tr><td><code>interiorId</code></td><td>Legacy single-id form, kept so older configs keep working. Use <code>interiorIds</code> for anything new.</td></tr><tr><td><code>soundVolume</code></td><td><code>0.0</code>-<code>1.0</code>.</td></tr><tr><td><code>proximity</code></td><td>Hearing distance in meters. Sounds fade out towards the edge of this radius.</td></tr></tbody></table>
