import javafx.scene.media.*; static MediaPlayer javaFXPlayAudio_player; static Lock javaFXPlayAudio_lock = lock(); svoid javaFXPlayAudio(File f) { initJavaFX(); lock javaFXPlayAudio_lock; if (javaFXPlayAudio_player != null) javaFXPlayAudio_player.stop(); else javaFXPlayAudio_player = new MediaPlayer(new Media(fileToURI(f))); javaFXPlayAudio_player.play(); } svoid cleanMeUp_javaFXPlayAudio { if (javaFXPlayAudio_player != null) { javaFXPlayAudio_player.stop(); javaFXPlayAudio_player = null; } }