Depends on
Required for this file to work correctly.
About Sound Library
Give your server any sound you want. SoundLibrary is a server-side sound library for Rust: drop .ogg files into a folder and every sound becomes instantly playable — positioned in the world, attached to players or entities, looped or played once.
No restart to pick up a new file — the plugin watches its sound folder live. Whether you want a raid alarm that shakes the whole map, a private voice line only one player hears, or ambient sound zones that ride along a moving object, you wire it up in one API call.
A complete playback API turns audio into a building block for other plugins: events, NPCs, minigames, raid notifications, proximity ambience. SoundLibrary does the hard part; your plugins do the fun part.
Features
-
Drop-in sound loading — add, replace, rename or delete a
.oggin the sound folder and it loads or unloads within seconds. No restart, no plugin reload, no console commands to teach the server about new files. -
Single sounds & sound sequences — a root
.oggfile is one sound; a subfolder of numbered files (1.ogg,2.ogg,3.ogg…) is a sequence — different sounds that play one after another in numeric order under a single name. Wind-up → loop body → wind-down, a three-part alarm, a scripted announcement: one play call runs the whole chain. - Positioned playback — play any sound at a world position for every connected player. One call, whole-server audio.
- Attached playback — parent a sound to a player, an entity, or a specific bone, so it follows its host wherever it goes. Entity playback is heard by players near that entity, not by the rest of the map — proximity-correct audio for free.
- Private playback — target a single player: only they hear it. Ideal for personal voice lines, UI-style chimes or per-player cues without leaking to everyone else.
- Looping — any playback can loop endlessly, positioned or attached, private or worldwide. Perfect for ambience and background music.
-
Sound zones — spawn an invisible trigger sphere at any position and radius; every player standing inside hears its sound, players leaving stop hearing it. Parent the zone to a moving object and its audio rides along — roaming ambience, event perimeters, hazard areas, moving machines. A
sourceOffsetplaces the audio point anywhere inside the zone. - No double playback — re-entering a zone continues the same sound instead of stacking a second copy; re-saving a file with identical content does not restart audio that is already playing.
- Precise stop control — stop one specific playback, every instance of a sound worldwide, a sound for one player, or everything a player is currently hearing. Stopping by name works even after the file behind the sound was replaced or deleted.
- Playback ids — every play call returns an id; check whether it is still playing or stop it at any moment, so your plugin always knows what is on air.
- Hot-reload safe — a plugin reload re-reads the folder; sounds that vanished from disk are dropped so nothing keeps playing as a ghost.
- Robust by design — files still being copied are picked up once they finish writing; corrupt or non-ogg files are rejected with a logged reason instead of breaking anything.
- Invisible by nature — players never see the machinery, they just hear the sound.
- Built-in admin tooling — a live table of loaded sounds with their lengths, instant in-game test playback, and flexible stop commands.
- Zone visualization — developers can see sound zone spheres and their labels drawn in the world. Tune placement without guessing.
API for developers
SoundLibrary is built ecosystem-first. Call it from any other plugin:
-
Playback —
PlaySoundAt(name, position, loop = false)— world-positioned playback for every connected player
PlaySoundFor(name, player, boneId = 0, loop = false)— attached to a player, heard only by that player
PlaySoundFor(name, entity, boneId = 0, loop = false)— attached to an entity, heard by players around it
PlaySoundFor(name, connection, loop = false)— targeted at one connection -
Stop —
StopSound(playbackId)— stop one specific playback
StopSound(name)— stop every playing instance of the sound, worldwide
StopSound(name, player)— stop that sound for one player only
StopSound(player)— stop everything that player currently hears -
Inspect —
IsSoundPlaying(playbackId),IsSoundLoaded(name),GetLoadedSoundNames(),GetSoundDuration(name) -
Sound zones —
CreateSphere(position, radius = 5, soundName = null, loop = false, sourceOffset = default)spawns a sound zone and returns it for whatever your plugin does next: parent it to a moving entity, attach it to a base room, park it at an event spawn. Pass no sound name to create a silent zone you fill in later. -
Runtime loading —
LoadSound(filePath)andUnloadSound(name)load or retire sounds on demand; unloading also stops any live playback of that sound.
Every play method returns a playback id on success and 0 if the sound could not be played. Keep the id to check or stop that exact playback — even while the same sound plays several times for several players.
Performance
- No frame hitches — sound loading is spread out over time, so dropping a large batch of files into the folder does not stall the server.
- Cleans up after itself — removed sounds free their memory, and everything tied to a player is released the moment they disconnect.
Configuration — there is none
Say goodbye to config files. The folder is the configuration:
-
data/SoundLibrary/YourSound.ogg→ a sound namedYourSound -
data/SoundLibrary/YourSequence/1.ogg,2.ogg,3.ogg, … → a sequence namedYourSequence: its sounds play one after another in numeric order. Files inside must be named with plain numbers.
That's the whole setup. No config JSON, no in-game editor to break, and nothing to migrate between versions.
Commands
-
snd.print— list every loaded sound with its length -
snd.play <sound> [player]— test-play a sound on the given player (or yourself) and show its playback id -
snd.stop— stop everything you hear -
snd.stop <name>— stop every instance of the named sound -
snd.stop <name> <player>— stop that sound for one player -
snd.stop <id>— stop one playback by its id
Permissions
-
soundlibrary.admin— access to allsnd.*console commands. Grant to admins only.
FAQ
How hard is setup?
Put a .ogg in the folder and it is playable within seconds. One permission covers the admin commands. If you can copy a file, you have deployed audio.
What are sequence folders for?
Sequential sound changes. Put numbered files in a subfolder and they play one after another under a single sound name — intro then loop then outro, a multi-stage alarm, a chain of voice lines. Your plugin calls one name; the order is set by the file numbers.
Can sounds move with objects?
Yes, twice over: attach playback to any entity (down to a bone) through the API, or parent a sound zone to a moving object and the zone carries its audio with it.
Will it lag my server?
No. Loading is spread over time and playback is lightweight, so even a large sound folder loads without stalling the server.
What happens on a plugin reload?
Sounds are re-read from the folder: files still on disk come back, removed ones disappear, and nothing keeps playing on stale audio.
Can several plugins play the same sound at once?
Yes — every play is independent, with its own id and its own listeners. One plugin stopping its playback never touches another's.
Quick Start
- Make sure ServerPrefabs is loaded (SoundLibrary requires it).
-
Drop a
.oggfile intodata/SoundLibrary. -
Grant yourself
soundlibrary.adminand runsnd.play YourSoundto hear it. -
Wire it into your plugins:
PlaySoundAt("YourSound", position)— that's the whole integration. - Update audio any time by replacing files in the folder while the server keeps running.
What servers build with it
- Event and raid drama — a map-wide klaxon the moment a raid event opens, with looping ambient score until it closes.
- Private cues — a chime only the rewarded player hears; voice lines only the quest owner hears.
- Living map ambience — looping shore, cave or machine sound zones placed around the map or parented to moving objects.
- Staged sound sequences — countdown beeps that change each step, an alarm that escalates, an announcement built from several voice lines — all from one sequence folder.
- Plugin ecosystems — a sound layer your other plugins share, instead of every plugin reinventing audio.
Compatibility notes
- Built for Carbon.
- Requires the ServerPrefabs library plugin.
- Input format is .ogg (Vorbis) only — other formats and corrupt files are rejected with a logged reason.
- Sound zones react to real players only; NPCs never trigger zone audio.
Support
Discord: [Discord link] — bug reports and API questions welcome. Author: 0xF.