[RELEASE] [UPDATED 2021] Dynamic Random music MP3 (from folder) for loading screen [FREE]

Hi guys!

Some server’s (maybe yours) have music (or not) when loading the game, but when you play a lot, it could be boring after 51861 replays.

So, here I come to share with you a piece of code and files to allow your server to have different music each time loading the game.

Requirements:

  • Brain
  • (Apache) WebServer (or emulated server with XAMPP/WAMP/LAMP/MAMP)
  • Any loading screen ressource with HTML content
  • MP3 Files (or OGG)

Download: https://mega.nz/file/rsw0mRJQ#ylxshSKJ4h0uSfSOwvB4_LEKqH6EIHMhkAvOerJHfzo

Steps

  • Extract the attachment archive to the main folder (root or httdocs/htdocs) of a webserver (it could be XAMPP/WAMP/LAMP/MAMP or Hosting Web)…
  • Remember the IP address (or URL) of the server where you sent the file.
  • Go to your loading Screen’s ressources and look for the .html file.
  • Open it with Notepad/Notepadd++/SublimeText…
  • And put this code in the HTML (don’t forget to edit yourWebServerIPOrURL):
<audio autoplay="" id="Loading" src="http://yourWebServerIPOrURL/musique.php?random" loop=""></audio>
  • Once it’s done, fill the “musiques” folder (on the webserver) with .mp3 musics you want, the musique.php file will select (randomly) your musics when the game load.

For OGG Lovers :
If you want to use .ogg files instead of .mp3 just edit the $extension variable at line 12 with the extension you want (example:)

$extension = 'ogg';

Sorry for my bad ENGLAISH, that’s because Omelette du fromage.

If you have questions, ask me here (in english or french) or on Discord (Robert Ford#5996)

Edited 24/01/2021

4 Likes

YES PLEASE, I l o v e earrape!

3 Likes

I love the touch of humor in your posts. :grinning:

2 Likes

Not working anymore :frowning:

Could you help me?

1 Like

Done & edited the original post :slight_smile:

1 Like