mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
feat: soundboard pads can load from a JSON5 file (DB fallback)
When the server (soundboard_sounds table) returns no pads, the client now loads them from a JSON5 config file (loadGamedata accepts plain JSON and JSON5). Useful when the DB / CMS isn't set up yet. File-defined pads play locally for the clicker; DB-backed pads still go through the server broadcast so everyone in the room hears them. Ships a radio-style soundboard-sounds.json5.example template.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{
|
||||
// Soundboard pads loaded from a file — used as a FALLBACK when the server
|
||||
// (soundboard_sounds DB table) returns no sounds. Copy this file to
|
||||
// `soundboard-sounds.json5` (without .example) and add your sounds. JSON5:
|
||||
// // comments and trailing commas are allowed.
|
||||
//
|
||||
// Fields:
|
||||
// id - unique number (pad key)
|
||||
// name - label shown on the pad
|
||||
// url - audio file URL (mp3/ogg/wav). Relative urls resolve against
|
||||
// `soundboard.url.prefix` (falls back to `asset.url`).
|
||||
//
|
||||
// NOTE: file-defined pads play LOCALLY for the person who clicks them. To
|
||||
// broadcast a pad to everyone in the room, the sound must exist server-side
|
||||
// in the soundboard_sounds table (same flow as custom badges). The file is
|
||||
// the no-DB / offline option; the DB is the multiplayer one.
|
||||
sounds: [
|
||||
// { id: 1, name: 'Airhorn', url: 'https://your-host/airhorn.mp3' },
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user