“mp3 player java” Kode Jawaban

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 e) {
        System.out.println("Error with playing sound.");
        e.printStackTrace();
    }
}
LoLGamer1002

java mp3 player

import java.io.File;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;

String bip = "song.mp3";
Media hit = new Media(new File(bip).toURI().toString());
MediaPlayer mediaPlayer = new MediaPlayer(hit);
mediaPlayer.play();
slapp kuk

Jawaban yang mirip dengan “mp3 player java”

Pertanyaan yang mirip dengan “mp3 player java”

Lebih banyak jawaban terkait untuk “mp3 player java” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya