Skip to content

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 ​

NeedsNotes
tm_libThe Twilight Moon library: settings, admin panel, notifications, locales and the framework bridge.
tm_soundThe audio engine.
ox_libInstalled next to tm_lib, which depends on it.
oxmysqlSaved libraries and booths.
OneSyncRequired for sounds attached to vehicles and players.

Install ​

  1. Start the resources in this order:
cfg
ensure ox_lib
ensure oxmysql
ensure tm_lib
ensure tm_sound
ensure tm_music
  1. The tables are created on first start.
  2. For YouTube search, set an API key in a private config file (optional, see Settings):
cfg
set tm_music_youtube_api_key "your key"
  1. Open the admin panel (/tmadmin) and pick Music to adjust anything.
  2. Phones: see Phone apps.
  3. 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 ​

PageWhat it covers
BoothsThe booth panel, and placing booths, speakers and control points.
Phone appslb-phone, NPWD, and the window.
Vehicle radiosThe three modes and how ownership works.
Placed speakersThe output only speaker API for placeable objects.
ExportsEvery export and event.
SettingsEvery 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 ​

VersionNotes
0.1.1The console prefix reads TM Music and uses the Twilight Moon colors.
0.1.0First release. Ported from the Lumen music resource and made framework neutral.