Sound where it belongs
- Doorbells, alarms and machinery at a world position, or attached to a moving networked entity.
Sound cues for the world, music for the venue, and listening controls for each player. Place a speaker, attach an alarm to a vehicle, or fade between two decks through one owned audio API.
local ok, handle = exports.np_audio:playOneShot('notify', {
coords = vec3(120.0, -200.0, 30.0),
bucket = 0,
})
if not ok then print(handle) endExample speaker coverage using the bundled alarm defaults; distances are illustrative.
Use a fixed coordinate for a doorbell or a networked entity for a moving source. Per-emitter reference distance, maximum distance and gain define its coverage. The strongest speaker contributes one signal.
Choose a falloff curve, optional wall probes, vehicle/water muffling, lowpass and reverb. The built-in backend provides HRTF directionality. The environmental model is an approximation.
Spatial audio reference →Schedule a common start, seek late listeners to the anchored position, queue approved songs and crossfade between two channels. Autoplay uses trusted cue durations.
Group sources under parent buses, mute a whole branch or schedule a volume ramp. Static scenes create several sources at once and roll back newly created sources if one entry fails.
Music channels reference →Server routing buckets, distance, player lists and custom audience policies decide who receives a source. Interior IDs add a local rendering gate.
Players save master and category levels, mute a category and enable streamer mode. These controls affect their own listening. The debug overlay shows active sources and emitter positions.
Commands and validation →ensure np_audio
add_ace group.admin np_audio.admin allowEnable OneSync. Three original WAV cues are bundled. Edit the cue catalog, limits, categories and allowed HTTPS hosts in configuration.
Register cues and buses through the np_addon API 1 lifecycle so they return after a host restart. Your resource owns its registrations and handles; stopping it releases them.
Installation guide →The built-in Web Audio player provides the full spatial, mixer and effects API. External direct media needs approved HTTPS hosts, CORS and a supported CEF codec.
GTA soundsets have limited transport/volume control. xSound provides compatibility playback. Compatible np_screens channels may own URL/YouTube music, keeping their own local preferences and effect limits.
Backend contracts →Register cues, play and control owned sources, define audience filters, create buses/scenes and manage music channels. Volumes use 0..1 and timestamps use the server clock.
Clients request only cue IDs. The server checks policy, cooldown and replay, then derives the player source and bucket. A local media report cannot change the shared queue.
Full exports and events →No. The built-in player runs independently; xSound and np_screens are optional adapters.
Existing resource calls remain independent. Voice capture, phone/radio calls and mic bridges belong to their voice resource.
It uses shared clock anchors and seeking. Cold decoding, network latency and live streams can affect timing.
Automated checks and Chromium playback pass. The documented two-client FiveM, soundset and streaming checks are still pending.
Resources can adopt the audio API through its documented server and client exports.