| | |
Creating a media player in Java
![]() |
•
•
Join Date: Jan 2008
Posts: 2
Reputation:
Solved Threads: 0
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.
•
•
Join Date: Mar 2004
Posts: 836
Reputation:
Solved Threads: 44
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
http://www.javazoom.net/index.shtml
•
•
Join Date: Jan 2008
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
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
•
•
Join Date: Mar 2004
Posts: 836
Reputation:
Solved Threads: 44
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:
How you stream the song from your own computer I'm not sure. You might need to run an icecast server.
This should play a stream:
Java Syntax (Toggle Plain Text)
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.
![]() |
Similar Threads
Other Threads in the Java Forum
- Previous Thread: Browsers information
- Next Thread: Binary Tree
Views: 7836 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Java
add android applet application arguments array arraylist arrays c# chat class classes client code compile compiler component constructor convert coordinates data database db desktop eclipse error event exception fast file filei/o forloop fractal givemetehcodez graphics gridlayout gui helpwithhomework html ide image images input interface j2me java jframe jmf jpanel jtextarea jtextfield key lazy linked linked-list list loop method methods mobile netbeans newbie node number object objects oracle page parameter pattern phone print problem programming read regex remove robot scanner screen search server set sms socket software sort source sql string swing text thread threads time timer tree url user windows





