Clip clip;
clip = AudioSystem.getClip();
clip.open(AudioSystem.getAudioInputStream(sound));
I mean, how to start playing clip always from the beginning. When I stop it in the middle and then start it again, it plays from the middle and that's what I do not want.
Call clip.setMicrosecondPosition(0)
before playing the clip again. This will reset the current position.
https://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/Clip.html#setMicrosecondPosition(long)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With