I am trying to play an audio clip in a loop until a different audioclip gets selected. When that happens it should wait for the current audio clip to finish and continue looping with the newly selected clip (gapless).
These audio clips were made to be played in loops and in succession. However it's important that the next clip doesn't start until some condition has been met.
I've tried using AVQueuePlayer which I got working quite well except for one thing, which is that remove(_ item: AVPlayerItem) seems to add a "stutter" to the currently playing clip. Almost like it's buffering or something. Which is strange because all audio files are embedded in the project.
The clips are quite short (between 1 and 2 seconds). How can I get this to work without a stutter? Or maybe using something entirely different even?
Update: I also tried using AVPlayerLooper, which works great with 1 clip but I can't tell it to continue looping using another clip (without a gap).
These audio clips were made to be played in loops and in succession. However it's important that the next clip doesn't start until some condition has been met.
I've tried using AVQueuePlayer which I got working quite well except for one thing, which is that remove(_ item: AVPlayerItem) seems to add a "stutter" to the currently playing clip. Almost like it's buffering or something. Which is strange because all audio files are embedded in the project.
The clips are quite short (between 1 and 2 seconds). How can I get this to work without a stutter? Or maybe using something entirely different even?
Update: I also tried using AVPlayerLooper, which works great with 1 clip but I can't tell it to continue looping using another clip (without a gap).