Creating a media player in Java

Reply

Join Date: Jan 2008
Posts: 2
Reputation: dragon99x is an unknown quantity at this point 
Solved Threads: 0
dragon99x dragon99x is offline Offline
Newbie Poster

Creating a media player in Java

 
0
  #1
Jan 31st, 2008
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?
Last edited by dragon99x; Jan 31st, 2008 at 3:46 pm.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 836
Reputation: Phaelax is on a distinguished road 
Solved Threads: 44
Phaelax Phaelax is offline Offline
Practically a Posting Shark

Re: Creating a media player in Java

 
1
  #2
Jan 31st, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2
Reputation: dragon99x is an unknown quantity at this point 
Solved Threads: 0
dragon99x dragon99x is offline Offline
Newbie Poster

Re: Creating a media player in Java

 
0
  #3
Feb 1st, 2008
Originally Posted by Phaelax View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 836
Reputation: Phaelax is on a distinguished road 
Solved Threads: 44
Phaelax Phaelax is offline Offline
Practically a Posting Shark

Re: Creating a media player in Java

 
0
  #4
Feb 2nd, 2008
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:
  1. BasicPlayer player = new BasicPlayer();
  2.  
  3. URL url = new URL("http://205.188.215.225:8018");
  4.  
  5. AudioFileFormat aff = AudioSystem.getAUdioFileFormat(url);
  6.  
  7. if (aff instanceof TAudioFileFormat)
  8. {
  9. Map props ((TAudioFileFormat)aff).properties();
  10. String title = (String)props.get("mp3.shoutcast.metadata.icy-name");
  11. String sUrl = (String)props.get("mp3.shoutcast.metadata.icy-url");
  12. String genre = (String)props.get("mp3.shoutcast.metadata.icy-genre");
  13. String bitrate = (String)props.get("mp3.shoutcast.metadata.icy-br");
  14.  
  15. player.open(url);
  16. player.play();
  17. }

How you stream the song from your own computer I'm not sure. You might need to run an icecast server.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 7836 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC