play mp3 file - Java Media

Java examples for Media:MP3

Description

play mp3 file

Demo Code


import javazoom.jl.player.*;
import java.io.FileInputStream;

public class playmp3 {
    public static void main(String[] args) {
        try {//w  w  w .j a va  2  s  .  c o m

            FileInputStream fis = new FileInputStream("1.MP3");
            Player playMP3 = new Player(fis);

            playMP3.play();

        } catch (Exception e) {
            System.out.println(e);
        }
    }

}

Related Tutorials