diff --git a/korau/src/jvmMain/kotlin/com/soywiz/korau/sound/impl/jna/JnaSoundProvider.kt b/korau/src/jvmMain/kotlin/com/soywiz/korau/sound/impl/jna/JnaSoundProvider.kt index dcac13f2b3..07bad5a962 100644 --- a/korau/src/jvmMain/kotlin/com/soywiz/korau/sound/impl/jna/JnaSoundProvider.kt +++ b/korau/src/jvmMain/kotlin/com/soywiz/korau/sound/impl/jna/JnaSoundProvider.kt @@ -333,7 +333,7 @@ class OpenALSoundNoStream( var times = params.times var startTime = params.startTime try { - while (times.hasMore) { + while (times.hasMore && !stopped) { times = times.oneLess channel.reset() AL.alSourcef(source, AL.AL_SEC_OFFSET, startTime.seconds.toFloat())