Answers for "mp3 player Java"

0

mp3 player Java

public void playSound() {
    try {
        AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("D:/MusicPlayer/fml.mp3").getAbsoluteFile());
        Clip clip = AudioSystem.getClip();
        clip.open(audioInputStream);
        clip.start();
    } catch(Exception ex) {
        System.out.println("Error with playing sound.");
        ex.printStackTrace();
    }
}
Posted by: Guest on October-28-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language