WhereiamL
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

  1. Stop your server (or prepare to restart the resource).
  2. Replace the contents of your xsound folder with betterxSound. Keep the folder named xsound.
  3. 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:stateSound event 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 set broadcastAce if you want only certain players to play server-wide sounds.
  • Tune config.youtubePoolMax if you run many simultaneous YouTube sounds.

On this page