I am developing an alarm clock program that plays an audio clip as an alarm. I can successfully play an audio clip, and terminate an inactive alarm. However, when I try to terminate an alarm that is currently playing, the audio keeps playing. Solutions I've tried were setting the clip to null, clip.stop(); and
public void stopSound(Clip clip){
clip.stop();
clip.flush();
clip.close();
}
Is there a way to end a clip at any percentage through a clip?