# Sounds System

`Sounds System` is a FiveM positional audio resource that supports local sound files, YouTube links, and SoundCloud links with real-time 3D spatial audio.

It is designed to let developers play both simple 2D sounds and advanced world-positioned audio with distance falloff, stereo panning, and vehicle-based occlusion. The system supports shared and dedicated DUI players depending on the source type and can be controlled entirely through exports.

With support for local files, embedded streaming sources, callbacks, and client/server playback control, the resource is flexible, modern, and suitable for immersive roleplay and utility systems.

### Features

* 2D and 3D positional audio
* Local audio file playback
* YouTube support
* SoundCloud support
* Distance-based volume falloff
* Stereo panning
* Vehicle occlusion filtering
* Streamer mode support
* Client and server exports
* Shared DUI playback for local sounds
* Dedicated DUI playback for embedded sources

### How it works

Each sound is registered under a unique ID and managed through the internal client registry.

Local files are played through a shared DUI instance for better performance, while YouTube and SoundCloud sounds use separate DUI instances because they require individual embedded players.

For positional sounds, the resource continuously updates player position, distance, stereo pan, and occlusion values so the sound behaves naturally in the world.

### Included Pages

* Installation
* Configuration

### Requirements

Before using this resource, make sure all required dependencies are installed and started correctly.

### Notes

* Supports local files and external streaming sources
* Positional audio includes stereo and occlusion logic
* Local file playback uses shared DUI instances
* YouTube and SoundCloud use dedicated DUI players
* The system can be controlled from both client and server


---

# 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://mskscripts.gitbook.io/mskscripts/scripts/sounds-system.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.
