Srcds downloading music

When people join my server i would like to have music playing, could you help? Thanks

I was thinking that adding music to the server loading screen was good, but it’s just annoying for people and they end up leaving.

But anyway.

<audio controls height="100" width="100" autoplay="true" hidden="true" loop="true">
      <source src="./{name}.mp3" type="audio/mpeg" autoplay="true" hidden="true" loop="true">
      <source src="./{name}.ogg" type="audio/ogg" autoplay="true" hidden="true" loop="true">
      <embed height="50" width="100" src="./{name}.mp3" autoplay="true" hidden="true" loop="true">

Add that to your HTML file, under body.

You need 2 files; an .ogg and .mp3 version of the song. (There are online converters )
Upload the 2 songs to your web hoster.

Credits: Streetser20

Where do i put the mp3 and ogg file, im running srcds

[editline]17th February 2013[/editline]

Oh i think i get it, No i don’t. i have the code in an html file called “loading”, i hope thats right. and i used the pathway for the mp3 and ogg but it won’t play

Did you upload the mp3 and ogg files to your hoster aswell?

The effects of music playing on a server are generally unfavorable (though your request is understandable if you are playing with a few friends. If you’re not, you’d better add a toggle).

Reminds me of that time I modded an HL2DM server to play a 70’s disco list and have forced flashing colored fog everywhere :smiley:

[editline]17th February 2013[/editline]

Oh yeah, but on a relevant note, you’re best bet is to download a streaming radio lua plugin and perhaps find a site that hosts your own radio station. If you want an elaborate playlist on your server and you choose lua’s play and Resource.addFile functions, you’ll have people stuck on downloading for a long time and will be ripping your nuthairs out converting everything to low-bitrate mp3’s to shorten the download size.

Well first i am running on srcds as a test server for when i buy one. I put the .mp3 and .ogg in my sounds folder and had the full pathway from C:/. And yet it still does not play. I was wonding if maybe it would play if it had items to download to the client

You should never need the full path. It is relative to either the gmod folder or the gmod/sounds folder. Try both, but definitely not the full path. If Garry’s Mod or SRCDS were to be able to see outside their directory, it would pose a security threat.

Thanks. But where should the path start, should i assume that it start in the garrysmod folder? so that it should look something like /sounds/“name.mp3”