Ive been trying for hours to play a WAV file but it always stays silent
heres my code
package soundboardfx;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.Media;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.ext.swing.SwingButton;
var player: MediaPlayer = MediaPlayer {
autoPlay: true
//repeatCount: MediaPlayer.REPEAT_FOREVER
volume: 1.0
mute: false
stopTime: 0s
media: Media {
source: “{DIR}areyouracist.wav”
}
};
Stage {
title: “meu barulhinho - MIDI file”
width: 250
height: 80
scene: Scene {
content: HBox{
spacing: 10
content: [
SwingButton {
text: “play”
action: function() {
player.play();
},
},
SwingButton {
text: “pause”
action: function() {
player.pause();
}
}]
}
}
};