[Socket] Send audio data
I wanna create an program with an server-client connection.
Server loads the .wav file > Send it to file while playing.
All clients are synchroned with the sound.
I allready can load a .wav file in an program and play it, but not over socket.
Can someone help me?
Going to be hard to do without details -- what you've tried and doesn't work, what you don't understand,... etc
Originally Posted by Dennis
Once you've loaded a WAV file, it's just bytes. You can send it over sockets like anything else.
pseudo-code for server
pseudo code for client
ServerSocket serverSocket = new ServerSocket(port);
Socket socket = serverSocket.accept();
There are a *lot* of detailes obscured in these code snippets, such as error handling, how to deal with multiple clients on the server using multiple threads, clean up of the sockets when you shut them down, fully reading off a socket, etc.
Socket socket = new Socket(host, port);