parent
ce39892873
commit
3a9e5f5f6a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
package model;
|
||||
|
||||
|
||||
import javafx.scene.media.AudioClip;
|
||||
import javafx.scene.media.Media;
|
||||
import javafx.scene.media.MediaPlayer;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Musique {
|
||||
|
||||
public void play(String path) {
|
||||
Media media = new Media(Objects.requireNonNull(getClass().getResource(path)).toExternalForm());
|
||||
AudioClip mediaPlayer = new AudioClip(media.getSource());
|
||||
mediaPlayer.volumeProperty().setValue(0.025);
|
||||
mediaPlayer.play();
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue