check sound added in sound class

This commit is contained in:
samuelsmith 2025-05-07 16:16:58 +02:00
parent 31571fcd99
commit f1e22e6b14
2 changed files with 12 additions and 0 deletions

Binary file not shown.

View File

@ -40,4 +40,16 @@ public class SoundEffect {
e.printStackTrace();
}
}
public void checkSound() {
try {
File file = new File("Voicy_Battle-Droid-Problem.wav");
AudioInputStream audioStream = AudioSystem.getAudioInputStream(file);
Clip clip = AudioSystem.getClip();
clip.open(audioStream);
clip.start();
} catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) {
e.printStackTrace();
}
}
}