Skip to content

np_audio v1.0.0 ​

One audio API for a doorbell, a moving vehicle, ambient machinery and a venue's music. Server resources register approved cues and own their sources; clients hear the sources they are eligible to receive. The built-in player supplies directional Web Audio without a framework, database or third-party sound resource.

What it provides ​

  • Sound cues: packaged files, approved HTTPS audio and GTA soundsets, with server-defined volume, duration, category, range and request policy.
  • World audio: coordinate or networked-entity emitters, HRTF directionality, three falloff curves and optional wall, vehicle, water and reverb effects.
  • Shared playback: server clock anchors, scheduled starts, late-listener seeking, loops, pause/resume/seek and volume ramps.
  • Mixing: hierarchical buses, mute, static scenes, music queues and synchronized crossfades between two decks.
  • Listening controls: local master/category levels and streamer mode, persisted per player, plus an emitter debug overlay.
  • Ownership: only the calling server resource controls its handles; sources and registrations are cleaned up when their owners stop.

First sound ​

lua
-- server: play a bundled cue at a server-known position
local ok, handle = exports.np_audio:playOneShot('notify', {
  coords = vec3(120.0, -200.0, 30.0), bucket = 0,
})
if not ok then print(handle) end

Private UI feedback uses the client export:

lua
exports.np_audio:playLocal('confirm')

Install with ensure np_audio and OneSync enabled. The three original bundled WAV cues are confirm, notify and alarm; frontend_accept uses GTA's HUD soundset. See Installation, Cues & playback and the full API.

Backend choices ​

The built-in backend is the default and supports the full spatial/effect/control API. Native soundsets, xSound, existing InteractSound assets and compatible np_screens music channels are available through documented adapters. Their capabilities differ; Integrations explains the boundaries. Running np_audio does not migrate another resource's existing sound calls.

Validation ​

The initial release has 35 automated behavioral checks, passing GitHub CI with Lua 5.4, and a real Chromium playback smoke check. Live FiveM validation is still required, particularly for native soundsets, entity streaming and shape tests. The demo and checklist make those checks reproducible. The source repository remains private; repository links require authorized access.