| | |
Creating a media player in Java
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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 4:46 pm.
•
•
Join Date: Mar 2004
Posts: 765
Reputation:
Solved Threads: 38
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: 765
Reputation:
Solved Threads: 38
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
| Thread Tools | Search this Thread |
-xlint android api applet application array arrays automation bi binary blackberry block bluetooth chat class classes client code compile compiler component database developmenthelp eclipse error event exception fractal freeze game gameprogramming givemetehcodez graphics gui health html ide image input integer j2me j2seprojects java javac javaprojects jetbrains jni jpanel jtable julia learningresources lego linux list login loop loops mac map method methods mobile netbeans newbie notdisplaying number online oracle page print problem program programming project qt recursion scanner screen server set singleton size sms sort sql string swing system template textfields threads time title tree tutorial-sample update variablebinding windows working xor





