betterxSound
Migration from xSound
Replace stock xSound with betterxSound — nothing else changes.
betterxSound is a drop-in replacement. The resource name, exports, and events are identical, so resources that already use xSound need no changes.
Steps
- Stop your server (or prepare to restart the resource).
- Replace the contents of your
xsoundfolder with betterxSound. Keep the folder namedxsound. - Start the server, or
restart xsound.
That is the whole migration.
What changed under the hood
- The YouTube memory leak is fixed (iframe teardown, no duration-probe player, idle browser recycle).
- The interact-sound emulator and crewphone events are now rate-limited and validated server-side.
- howler is bundled locally and bumped to 2.2.4; jQuery and DOMPurify are bundled too.
What did not change
- Resource name:
xsound. - Every export and its signature (Exports).
- The
xsound:stateSoundevent and the interact-sound (InteractSound_*) event names. - The NUI origin
cfx-nui-xsound.
Do not rename the folder. Exports, events, and the NUI origin all resolve against xsound;
renaming it breaks every resource that calls xSound.
After migrating
- Review
config.security— the defaults are safe, but setbroadcastAceif you want only certain players to play server-wide sounds. - Tune
config.youtubePoolMaxif you run many simultaneous YouTube sounds.