tm_music
Music for the world. A personal player on the phone, jukebox booths people walk up to, a radio in every car, and station radio, all built on tm_sound. It runs on ox_core, Qbox, QBCore and ESX, and has an app for lb-phone and NPWD.
Everything is tuned in game from the tm_lib admin panel (/tmadmin). There is no config file.
Features
- Personal player. Every character has favorites and playlists, saved in the database. Music goes to private headphones, or comes out of the phone so people nearby hear it.
- Booths. Staff place and edit booths from a panel in the admin hub (or with a command). Players open it at a control point and the booth's own favorites and playlists play through its speakers for everyone nearby.
- Play on. From the phone or the window, a player connects to nearby speakers (a booth, a vehicle radio or a placed speaker), plays their own library through them, and links up to four more speakers to the same music. Only one person controls a speaker at a time: anyone else asks, and the controller allows or denies.
- Vehicle radios. The radio of the vehicle you are in. The owner (per the framework) gets the radio's own saved library, everyone else gets the stations and their own library.
- Station radio. A list of internet radio streams that staff edit in game.
- YouTube search. Players search by name or paste a link. Direct files, HLS, YouTube, Vimeo, Twitch, TikTok, Wistia and Spotify links all work (the sources page of the tm_sound docs lists the limits of each player).
- Phones. An app for lb-phone and for NPWD, or the same player in its own window with
/tm:music(or/music). - Open for other resources. Output only speakers (for placeable objects), vehicle radios installed by scripts, and lending a booth's speakers to a TV or a DJ show. See Exports.
Requirements
| Needs | Notes |
|---|---|
tm_lib | The Twilight Moon library: settings, admin panel, notifications, locales and the framework bridge. |
tm_sound | The audio engine. |
ox_lib | Installed next to tm_lib, which depends on it. |
oxmysql | Saved libraries and booths. |
| OneSync | Required for sounds attached to vehicles and players. |
Install
- Start the resources in this order:
cfg
ensure ox_lib
ensure oxmysql
ensure tm_lib
ensure tm_sound
ensure tm_music- The tables are created on first start.
- For YouTube search, set an API key in a private config file (optional, see Settings):
cfg
set tm_music_youtube_api_key "your key"- Open the admin panel (
/tmadmin) and pick Music to adjust anything. - Phones: see Phone apps.
- Place your first booth: open
/tmadmin, pick Music and choose New booth (see Booths). From a chat, stand where it goes and run/tm:musicbooth add club Night Club.
A release already contains the built interface. If you build from source, run pnpm install and pnpm build in tm_music/ui.
Pages
| Page | What it covers |
|---|---|
| Booths | The booth panel, and placing booths, speakers and control points. |
| Phone apps | lb-phone, NPWD, and the window. |
| Vehicle radios | The three modes and how ownership works. |
| Placed speakers | The output only speaker API for placeable objects. |
| Exports | Every export and event. |
| Settings | Every setting in the admin panel. |
Languages
Text is read from locales/<language>.json and follows ox_lib's ox:locale convar (setr ox:locale es). English is the fallback. To add a language, copy locales/en.json to locales/<code>.json and translate the values.
Changelog
| Version | Notes |
|---|---|
| 0.1.0 | First release. Ported from the Lumen music resource and made framework neutral. |