Skip to content

Commit

Permalink
TTS fixes (readium#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
qnga authored Jun 17, 2024
1 parent 62f8fb8 commit 4a2e9d3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@ internal class TtsPlayer<S : TtsEngine.Settings, P : TtsEngine.Preferences<P>,
nextUtterance = contextNow.currentUtterance
)
utteranceMutable.value = utteranceWindow.currentUtterance.ttsPlayerUtterance()

if (playbackMutable.value.state == State.Ended) {
playbackMutable.value = playbackMutable.value.copy(state = State.Ready)
}
}

private suspend fun tryLoadNextContext() {
Expand Down Expand Up @@ -506,6 +510,7 @@ internal class TtsPlayer<S : TtsEngine.Settings, P : TtsEngine.Preferences<P>,
playbackMutable.value = playbackMutable.value.copy(
state = State.Ended
)
playbackJob?.cancel()
}

private suspend fun playContinuous() {
Expand Down

0 comments on commit 4a2e9d3

Please sign in to comment.