diff --git a/src/SoundPlayer.java b/src/SoundPlayer.java deleted file mode 100644 index 1bb19c7..0000000 --- a/src/SoundPlayer.java +++ /dev/null @@ -1,34 +0,0 @@ -package impl; - -import javax.sound.sampled.*; -import java.io.File; -import java.io.IOException; - -public class SoundPlayer { - private Clip clip; - - public SoundPlayer(String filePath) { - try { - File soundFile = new File(filePath); - AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(soundFile); - clip = AudioSystem.getClip(); - clip.open(audioInputStream); - } catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { - e.printStackTrace(); - } - } - - public void play() { - if (clip != null) { - clip.setFramePosition(0); // Rewind to the beginning - clip.start(); - } - } - - public void stop() { - if (clip != null && clip.isRunning()) { - clip.stop(); - } - } - -} \ No newline at end of file