PDA

Click to See Complete Forum and Search --> : How to: Servers play music, Client controls this and gets up to date information


Edgar
Apr 20th, 2006, 06:05 AM
I plan to write the following application

Servers
Several computers (servers) in a network play music (from an application which I will design). These computers will be somewhere hidden in a cabinet without a user

Client(s):
From one (or maybe more then one computer) (the administrator console) it should be possible to control the servers which play the music. I guess just to send commands like START or STOP from the client to one server is relative simple, but I also want that the client receives information about the current state like: Which title is currently played, time left and maybe some kind of VU-Meter to show the current output signal. If possible I want this information pushed from the servers to client. So if the title changes the servers send this information just one time to all clients (instead of the clients asking every second what is currently played).

I have experience in VB6 and APIs and I am able to write the application locally. But I have no idea which technology I can/should use to do this over the network.
I will use this in a local area network only. I plan to use Windows XP as servers and as clients.
Maybe I should run IIS on each server and a web interface on the client to see what’s happening. This is just an idea. The last time I works with a web interface was with ASP 1.0.

If it would be a lot easier to do the described with .net this is also acceptable. But till now I tried to avoid spending lots of time learning .net

Please let me know which technical possibilities exist to so something like this.

Thank you very much for your help

Edgar

k1ll3rdr4g0n
Apr 21st, 2006, 10:38 AM
This is a very easy concept lemme lay it out for you:
(Using TCP, with the VB6 winsock control).
Setup a server, have it listen on a random port you specify (I picked 555 for mine, I'll upload later and you can see what I am talking about). Make it so its just password auth, in other words theres no username just a password that is sent to verify the user. Have it listen for 'play' 'stop' 'next' (You can use APIs to find out volume level and so on so you can send it to the client) ect...

When the client connects it will send the password, and the server will know who this user is and 'log' them in so to speak. And the client will work simply, if the user presses the Play button, itll send a TCP packet of 'play' to the server and the server will start to play music. Same thing for stop or next.

I think you somewhat get the idea right now, I'm very tired right now so it may not make that much sense, but I'm sure its enough for you to figure out.

Al42
Apr 22nd, 2006, 07:49 PM
You can save a lot of network traffic by making the VU mater local. Just monitor the output level of the sound card.

Edgar
Apr 23rd, 2006, 02:18 AM
Thank you for the help.

The winsock control looks promising top me. I just checked the example here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingwinsockcontrol.asp

I plan to use TCP to send the commands like PLAY and STOP and acknowledge that they are send and executed.
For the status information like "which title is playing" and maybe the "VU Meter" I plan to use UDP.

If you have further advise please let me know

AL42: About your advise with the local VU meter. The idea is that the music is played on the server and that the information about the current output level is shown on the client. So the VU meter has to be on the client. I understand that it will create some traffic. But if the VU meter shows only 10% steps (or in this range) and if I update it only maybe every second this is hopefully acceptable. I will try and look how much traffic it really creates.

Edgar

k1ll3rdr4g0n
Apr 23rd, 2006, 05:53 PM
Honestly, it wont generate THAT much traffic to where you should be worried about saving some bytes.

@Al42
Acctually, you only need to worry about that if you have a hub. If you have a switch then it knows where to send it and theres pretty much no worries.

Al42
May 6th, 2006, 11:12 AM
Acctually, you only need to worry about that if you have a hub. If you have a switch then it knows where to send it and theres pretty much no worries.That depends entirely on the topography of the network. If you keep any common pipe filled you've effectively crashed the network.

k1ll3rdr4g0n
May 6th, 2006, 01:15 PM
That depends entirely on the topography of the network. If you keep any common pipe filled you've effectively crashed the network.

Intresting, seeing as I stream music from my main computer to my laptop wirelessly plus use my pocket pc wirelessly (for hours on end) (which uses mbs not kbs), and I have no problems.
No notice of slow down whatsoever. Seeing as this is a home network he doesn't have to worry about saving that extra kilobyte. There is no need to. Like I said if your using a switch then everything is sent to the right place automatically, if you have a hub then the data is sent to every port instead of the port its supposed to goto, which will cause a slow down if you do a lot of network related traffic.

Techno
May 7th, 2006, 06:28 PM
ive done a similar thing in C# and WMP10 - using PC a server and a smartphone/PPC as a client