Tremulous Forum

Community => Servers => Topic started by: Agresszor on October 28, 2008, 08:57:45 am

Title: Play music to players
Post by: Agresszor on October 28, 2008, 08:57:45 am
How can i play music as admin to players? You know some funy mp3.
Title: Re: Play music to players
Post by: David on October 28, 2008, 11:15:36 am
Thankfully you can't
Title: Re: Play music to players
Post by: Asvarox on October 28, 2008, 05:13:27 pm
You can use voip, but only those who have voip enabled will hear it (and probably ignore you).
Title: Re: Play music to players
Post by: Lava Croft on October 28, 2008, 05:14:21 pm
You need to be able to execute the 'music' command for all clients, while all the clients also need to be in possesion of your 'funy mp3'.

Should not be too hard to code.
Title: Re: Play music to players
Post by: Amanieu on October 28, 2008, 06:05:55 pm
1) No mp3 support in clients (except fsm-trem)
2) You can't make a client play music remotely
3) Yeah voip would be the only way, but then you don't get the whole population
Title: Re: Play music to players
Post by: TheLuciferSausage on October 28, 2008, 06:10:26 pm
Thankfully you can't

Indeed!! ;D

Some reasons:
Bandwidth - Streaming a full version of a song (4-5 minutes) takes up huge resources and LAGS the game.
Taste In Music - Everyone has different tastes in music. What songs you like, others may detest. I know, I know, it's hard to believe not everyone loves Barry Manalo as much as you do, but the last thing you want to do is drive people away before they even play at your server.
Music Already Playing - Now days, people spend a lot of time on their computers. Because of this, they often have music playing from Cd's, MP3s, Internet radio, etc. on their computer. How annoying it may be when you enter a server and it starts playing music that mixes in with your music? Nothing fun about trying to listen to two tracks at the same time. The quick fix will be to leave your server.
Legal Issues - Do you have the legal right to broadcast the song you want play as background music? Yeah, no RIAA will come see if your server is playing copyrighted music, but it's not nice to do that anyway.
Not giving the right to decide - Can players decide to STOP your music if they want, or pause it, or turn the volume a little bit down? They'll need to do a callvote lol
Extracted from ezinearticles.com/?Why-You-Should-Avoid-Background-Music-on-Your-Website and adapted for Trem servers.
Title: Re: Play music to players
Post by: Syntac on October 28, 2008, 08:39:52 pm
It's possible to stream music over the connection with some creative net code, but certainly not a good use of the developer's time. Also, any "funny MP3" you play will get very old very quickly.

Oh, and you'd have to use UDP to transfer the audio with any sort of speed. For many people, this would make it impossible to hear anything but the occasional lucky packet.
Title: Re: Play music to players
Post by: David on October 28, 2008, 09:32:44 pm
Oh, and you'd have to use UDP to transfer the audio with any sort of speed. For many people, this would make it impossible to hear anything but the occasional lucky packet.
If you have notable packet loss then you need to fix your connection.  Just because its called "best effort" doesn't mean its shit.  I would guess well over 99% of packets get through fine.
Title: Re: Play music to players
Post by: Syntac on October 28, 2008, 09:36:08 pm
You're very right about that, but the fact remains... There are people whose intarwebz are that borked.

Those with high pings might also have choppiness issues.
Title: Re: Play music to players
Post by: gimhael on October 28, 2008, 10:59:59 pm
You could (theoretically) put the sound file into a custom pk3 and then add an event that starts to play the music. That would eliminiate all the streaming issues, but of course all your clients have to download the pk3 and you can only play the song(s) that you packed into it.
 
Title: Re: Play music to players
Post by: Paradox on October 28, 2008, 11:51:06 pm
Install Shoutcast DAS on server.
Install Shoutcast DSP client on, well, client.

Tell people to listen to ipaddress:8000 or whatever you have it configured to.
Title: Re: Play music to players
Post by: Agresszor on October 29, 2008, 05:56:08 pm
Well i think the custom pk3 will be the solution. How make a simple pk3 what only contain the necessary sound files? And what type this simple wav? And how can force the clients to download this who join to my server? And how can i play them with a single bind? In call of duty 2 i meet many servers with this solution.
Title: Re: Play music to players
Post by: David on October 29, 2008, 07:36:57 pm
A pk3 is just a zip.
But sounds won't work, you needs a custom QVM too so you can play them.
Title: Re: Play music to players
Post by: kangounator on October 29, 2008, 11:36:50 pm
You'd need a qvm with a music <name> command that'd play the given music and a pk3 with that musics in it.

Anyway, spend your free time with something else, unless you have too much of it.
Title: Re: Play music to players
Post by: Agresszor on October 31, 2008, 01:54:41 pm
Ehh  :-\ i dont know why so complicated this. Well thanks all.
Title: Re: Play music to players
Post by: Syntac on October 31, 2008, 10:03:55 pm
Simple answer: Because it isn't possible, nor should it ever be.
Title: Re: Play music to players
Post by: gimhael on November 01, 2008, 10:05:37 am
Simple answer: Because it isn't possible, nor should it ever be.

Sorry to disappoint you, but every client and cgame I know has this already built in, all it needs is a new command on the server to change the background music.
 
Title: Re: Play music to players
Post by: Amanieu on November 01, 2008, 11:05:19 am
Now that I think about it, gimhael is right, all you need to do is make them download the music in a pk3 and set some configstrings.
Title: Re: Play music to players
Post by: Syntac on November 01, 2008, 04:54:32 pm
I was talking about streaming audio, but meh.
Title: Re: Play music to players
Post by: snb on November 02, 2008, 07:46:17 pm
lol you can make them hear music with them not bieng able to mute you, its quite easy a few modifications to the hlss thing for the quake engine and your ready to go. of course they can still boot you but i think that causes them to hear the last ten seconds of the song to reapeat untill they re-joinn or new round or map.
Title: Re: Play music to players
Post by: tyranis on November 02, 2008, 09:25:54 pm
A custom pk3 could be used, then of course no one in their right mind would play on your server with that kind of garbage.
Title: Re: Play music to players
Post by: Einstein on November 03, 2008, 09:46:51 pm
Again, while I agree that this is a REALLY BAD IDEA 99% of the time, it is possible; if you wanted a "tune-of-the-day" or an aural connection message when you logged on, you could autodownload a pk3 that overwrote the previous one and allowed you to play a .wav file. If you made it loop, made it arbitrary, made it annoying, or made it pointless, though, you're just asking people to ignore your server forever and then some.