943,816 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 24716
  • Java RSS
Jan 31st, 2008
-2

Creating a media player in Java

Expand Post »
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 4:46 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dragon99x is offline Offline
2 posts
since Jan 2008
Jan 31st, 2008
1

Re: Creating a media player in Java

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
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Feb 1st, 2008
0

Re: Creating a media player in Java

Click to Expand / Collapse  Quote originally posted by Phaelax ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dragon99x is offline Offline
2 posts
since Jan 2008
Feb 2nd, 2008
0

Re: Creating a media player in Java

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:
Java Syntax (Toggle Plain Text)
  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.
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Browsers information
Next Thread in Java Forum Timeline: Binary Tree





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC