I wish to use one of my local sound files to provide background music, but I get this error message:
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\Program Files\Amazon Corretto\jdk1.8.0_232\jre\bin\glib-lite.dll
But my code is as follow:
public class DungeonGUI extends Application {
private Dungeon dungeon;
private Stage stage;
private GridPane root;
private Button attack;
private Button heal;
// private Button checkInventory;
private Button save;
private Text characterHealth;
private Text characterPower;
private Text characterInventory;
private Text monsterHealth;
private Text monsterPower;
private File audioFile = new File("C:/Users/15774/Downloads/oof.mp3");
@Override
public void start(Stage stage) throws Exception {
setButtons();
dungeon = new Dungeon();
setTexts();
this.stage = stage;
root = new GridPane();
heal.setOnAction(this::onHeal);
attack.setOnAction(this::onAttack);
save.setOnAction(this::onSave);
stage.setTitle("Dungeone Dungeon");
root.setAlignment(Pos.CENTER);
setMedia();
setupRoot();
setStage(stage);
}
private void setMedia() {
Media media = new Media(audioFile.toURI().toString());
MediaPlayer mediaPlayer = new MediaPlayer(media);
mediaPlayer.setAutoPlay(true);
}
As you can see I did not call program files at any time. What might be the problem?
P.S.: this is only part of my code. If you guys need more information just shoot a comment.