diff --git a/OOP_2B1_Project/Voicy_Battle-Droid-Problem.wav b/OOP_2B1_Project/Voicy_Battle-Droid-Problem.wav new file mode 100644 index 0000000..b7b32bf Binary files /dev/null and b/OOP_2B1_Project/Voicy_Battle-Droid-Problem.wav differ diff --git a/OOP_2B1_Project/src/backend/SoundEffect.java b/OOP_2B1_Project/src/backend/SoundEffect.java index e747977..441d94f 100644 --- a/OOP_2B1_Project/src/backend/SoundEffect.java +++ b/OOP_2B1_Project/src/backend/SoundEffect.java @@ -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(); + } + } }