diff --git a/common/src/main/kotlin/org/wycliffeassociates/otter/common/domain/narration/Narration.kt b/common/src/main/kotlin/org/wycliffeassociates/otter/common/domain/narration/Narration.kt index be89471044..f731365f5f 100644 --- a/common/src/main/kotlin/org/wycliffeassociates/otter/common/domain/narration/Narration.kt +++ b/common/src/main/kotlin/org/wycliffeassociates/otter/common/domain/narration/Narration.kt @@ -338,7 +338,6 @@ class Narration @AssistedInject constructor( fun onPlaybackFinished() { if (lockedVerseIndex != null) { - player.pause() seek(0) } } diff --git a/jvm/device/src/main/kotlin/org/wycliffeassociates/otter/jvm/device/audio/AudioBufferPlayer.kt b/jvm/device/src/main/kotlin/org/wycliffeassociates/otter/jvm/device/audio/AudioBufferPlayer.kt index 75f49ac8e5..f82f344c6e 100644 --- a/jvm/device/src/main/kotlin/org/wycliffeassociates/otter/jvm/device/audio/AudioBufferPlayer.kt +++ b/jvm/device/src/main/kotlin/org/wycliffeassociates/otter/jvm/device/audio/AudioBufferPlayer.kt @@ -207,10 +207,11 @@ class AudioBufferPlayer( } player.drain() if (!pause.get()) { - listeners.forEach { it.onEvent(AudioPlayerEvent.COMPLETE) } + pause.set(true) player.close() startPosition = _reader.totalFrames seek(startPosition) + listeners.forEach { it.onEvent(AudioPlayerEvent.COMPLETE) } } } catch (e: LineUnavailableException) { errorRelay.accept(AudioError(AudioErrorType.PLAYBACK, e))