I use java sound api and loop a track within a specific range.
All works, but the problem is, that I want to playback ONLY the range.
so the track loops but after the loop, the track starts playing the position after end. But I only want to play the range within the loop.
In java api, it is said:
void loop(int count)
Starts looping playback from the current position. Playback will continue to the loop's end point, then loop back to the loop start point count times, and finally continue playback to the end of the clip.
How can I avoid the "and finally continue playback to the end of the clip".
I tried it with that:
which works as expected (only the range is played), but I only want to loop it once and not CONTINUOUSLY.
If I do that, the clip is not played, as the stop-method is invoked.
If I do that, the thread does not work (I get a exception..java thread not mine..)