import com.sun.javafx.application.PlatformImpl; import java.io.File; import java.net.MalformedURLException; import javafx.application.Platform; import javafx.scene.media.AudioClip; /** * * @author kirill */ public class AudioClipTest { public static void main(String[] a) { PlatformImpl.startup(new Runnable() { @Override public void run() {} }); try { File file = new File("test.mp3"); final AudioClip clip = new AudioClip(file.toURL().toString()); new Thread(new Runnable() { @Override public void run() { while (true) { try { Thread.sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } Platform.runLater(new Runnable() { @Override public void run() { clip.play(); } }); } } }).start(); } catch (MalformedURLException mex) { mex.printStackTrace(); } } }