How to Play an MP3 File in Java

JLayer MP3 Library


JLayer 1.0 is a popular open source MP3 player for Java. Is has all kinds of features. You can download it directly from javazoom.net. This includes all of the documentation and the jar file jl1.0.jar.


How to Play an MP3 File


The file MP3.java is a bare bones Java program that uses JLayer to play the MP3 file specified on the command line. It plays the MP3 file in a separate thread, so you are free to perform other computation while the song plays. In order to compile and execute it, you need to put the file jl1.0.jar in your current working directory (or classpath). Instructions for compiling and executing (depending on your operating system) are included in the .java file.



Kevin Wayne
Introduction to Computer Science
Last modified: Wed Jul 11 22:25:37 EDT 2005