I had this crazy idea of creating a media player using java that would stream files from from my desktop computer, which I would set up some sort of server app for, and talk to a portable client app that I could download on any of the other computers on campus. This way I can always have my music playing without having to have my ipod. I just had a question of where should I start? I know a little about networking, I have created a simple instant messenger but that is about it. I don't know what class I need to implement to transfer songs, rather than text like in my instant messenger. What are some good ideas?

This is usually the first site I point people to when they want to make a java music player.
http://www.javazoom.net/index.shtml

Actually I already have downloaded the javazoom classes and that works perfectly but I am contemplating how to go about streaming the music files from my desktop. I been reading the FileReader class api but I still can't tell which classes I SHOULD use to get it to work.

I know the javazoom packages will allow you to listen to a stream, but I haven't dealt with actually creating the stream itself (though I been meaning to do so). I know it'll connect to ice/shoutcast streams, so maybe that's something to look at.

This should play a stream:

BasicPlayer player = new BasicPlayer();

URL url = new URL("http://205.188.215.225:8018");

AudioFileFormat aff = AudioSystem.getAUdioFileFormat(url);

if (aff instanceof TAudioFileFormat)
{
	Map props ((TAudioFileFormat)aff).properties();
	String title = (String)props.get("mp3.shoutcast.metadata.icy-name");
	String sUrl = (String)props.get("mp3.shoutcast.metadata.icy-url");
	String genre = (String)props.get("mp3.shoutcast.metadata.icy-genre");
	String bitrate = (String)props.get("mp3.shoutcast.metadata.icy-br");

	player.open(url);
	player.play();
}

How you stream the song from your own computer I'm not sure. You might need to run an icecast server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.