Tabletop Simulator

Tabletop Simulator

151 ratings
Custom MP3 Player
   
Award
Favorite
Favorited
Unfavorite
Game Category: Original Games
Number of Players: 1, 2, 3, 4
Assets: Scripting
File Size
Posted
16.622 KB
11 Apr, 2018 @ 10:01am
1 Change Note ( view )

Subscribe to download
Custom MP3 Player

Description
📌 I realize this is a popular workshop item and will keep it up on the workshop for posterity.
However I will no longer offer support for it as there have since been several additions and implementations that supersede it's functionality. Everything below is to be considered legacy information that may not be accurate or valid anymore. Thank you for your understanding.


Custom MP3 Player
This tool allows you to play your custom MP3s, build playlists and have functioning audio controls in sync with your connected clients.

Features
  • Playing custom MP3 and other HTML5 supported formats
  • Editable Playlists with readable names
  • Chat Commands
  • Audio Controls synced with connected clients
  • Unity Bluetooth Speaker prop

How to use it
Usage instructions are provided with events and chat commands, but here is a rundown of the base functionality.

Start by dropping a tablet on to the speaker. If it successfully links to the tablet the speaker will turn on and the tablet will be highlighted in blue.

You have two input fields, one for URLs pointing to your music and another for assigning readable names to your playlist entries. Each entry should be separated by a comma and you can add a breakline (enter) if that helps you with readability. Here is an example:

URL INPUT - this field is for the direct links to your mp3s

NAME INPUT - this field is for adding readable names for track display
Candyland, Safari Fruits, Hollah!

You can store your playlists in any way you want, using in game objects, notecards, the notebook or externally in a text editor. You can always add entries on the fly and hitting the [CONFIRM PLAYLIST] button to update the player with your newly added songs. Playback is continuous with a javascript event listener, so you do not need to switch to the next track when one is done playing.

Your MP3s have to be uploaded and hosted online. I will NOT host anything for you.
Help eachother out in the comments for hosting solutions, but I do not take responsibility for any potential copyright infringement (ergo NCS). Hosting and using MP3s is your responsibility and done at your own or your providers discretion.

Inline (on the web app) controls can be used but will only apply to the client who used the input. For multiplayer playback it is strongly recommended to only use the inputs on the player/speaker.

If you know a little bit about LUA you can also add chat commands to load a playlist. The !help command demonstrates this by setting the value of the inputs from a predefined string in the script. The strings are formatted just like manual input, but with using \n for breaklines instead. Poke around in the script to find them.

self.editInput({index=0, value=ncs_infinity}) self.editInput({index=1, value=ncs_infinity_names})

How it works
The speaker/player is built around a simple web app I built specifically for this project. We encode strings from our inputs in to a URL and send it to the tablet. PHP gets the URL with
$url = $_GET['url']; and the javascript splits it up in to it's respective segments, those being
Track URL - Track Name - Track Number - Volume.

The downside of this is that all requests refresh the page, thus causing volume control and new playlist entries to stop the music and start playback from the beginning. I can currently not fix this as it's an inherent issue with mix and matching local playback (javascript) and updating things for all connected clients. Likewise with difference in loading times for songs, desyncing can occur on continuous playback because the music plays locally. The upside is a fairly functional custom MP3 player that syncs inputs with it's clients ;)

The LUA, JavaScript, HTML+CSS is public grounds; read, use and steal it all you want.
(but feel free to leave a credit disclaimer if you do)

The speaker prop is free to use and distribute as is provided - compiled as an assetbundle.
Feel free to use it for other projects and leave a credit disclaimer if you're feeling generous.

Official Discord: https://discord.gg/d2w8jcp

[ PATREON ][www.patreon.com]
Special thanks to my (current and past) Patreon supporters for supporting my projects:
  • Jeremy. S
  • Platypus
  • Corrodias
  • Ash Black
  • Connor
112 Comments
ScarletDuke 22 Jun, 2022 @ 8:55am 
I feel like this would be really cool if it worked with the in-game MP3 player instead of a tablet. I might reprogram it to work that way, if it's alright with you.
Cornhole Von Diggler 31 Oct, 2021 @ 12:04pm 
I know this is obsolete, but it provides so much more functionality than the in game player does. We got everthing to work except when you hit play on the MP3 player, the tablet just clears and nothing plays. It works through the tablet but that's only client side.

Any way to fix the play button on the player?
DASH.RABBIT 30 Jan, 2021 @ 5:53pm 
The controls for this feel extremely convoluted, and the total lack of any ability to use your own Music folder really makes it not feel worthwhile. It's also a pain to move around because the Grab tool refuses to work with it, and instead you get this purple fire icon that I can't make heads or tails of.
ulia  [author] 10 Oct, 2020 @ 12:13am 
They were never meant to be editable on the site itself.
Kanthier 9 Oct, 2020 @ 6:01pm 
Unfortunately, it seems the name and URL fields are un-editable on the website-side (noticed in-game, verified in out-of-game browser)
Wanderer 19 Sep, 2020 @ 3:47pm 
I don't think this is obsolete at all, i can't add songs in bulk with the native MP3 player.

In my case i need to add an impressive amount of sound clips, but the MP3 Player only let's me do it one by one.
gerrardokrane 8 Jul, 2020 @ 9:01am 
Its unnable to edit URL or Name field for me!
fermarve 4 May, 2020 @ 4:56pm 
how do I bring it into a game? I subsrcibed but I cant find how to add it to a game
DerKrieger29 4 Sep, 2019 @ 6:14pm 
would be perfect if you could just supply YouTube urls
Ilija 24 Aug, 2019 @ 6:36pm 
F