From 46df883770ab68e3cda5f4aceaf540174ff25d87 Mon Sep 17 00:00:00 2001 From: Samuel Whittenberger Date: Mon, 25 Sep 2023 17:39:16 -0400 Subject: [PATCH] update pause tracking in tts engine --- src/plugins/tts/AbstractTTSEngine.js | 2 ++ src/plugins/tts/plugin.tts.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/tts/AbstractTTSEngine.js b/src/plugins/tts/AbstractTTSEngine.js index 46a0a373f..68b864bd6 100644 --- a/src/plugins/tts/AbstractTTSEngine.js +++ b/src/plugins/tts/AbstractTTSEngine.js @@ -80,6 +80,7 @@ export default class AbstractTTSEngine { */ start(leafIndex, numLeafs) { this.playing = true; + this.paused = false; this.opts.onLoadingStart(); this._chunkIterator = new PageChunkIterator(numLeafs, leafIndex, { @@ -95,6 +96,7 @@ export default class AbstractTTSEngine { stop() { if (this.activeSound) this.activeSound.stop(); this.playing = false; + this.paused = true; this._chunkIterator = null; this.activeSound = null; this.events.trigger('stop'); diff --git a/src/plugins/tts/plugin.tts.js b/src/plugins/tts/plugin.tts.js index 530ba9403..76b41190c 100644 --- a/src/plugins/tts/plugin.tts.js +++ b/src/plugins/tts/plugin.tts.js @@ -251,7 +251,7 @@ BookReader.prototype.ttsPlayPause = function() { this.ttsToggle(); } else { this.ttsEngine.togglePlayPause(); - this.ttsUpdateState(this.ttsEngine.paused); + this.ttsUpdateState(); } };