bookreader icon indicating copy to clipboard operation
bookreader copied to clipboard

Google Chrome: TTS speeds through passages when tab is muted

Open sbwhitt opened this issue 2 years ago • 3 comments

Description

What problem are we solving? What does the experience look like today? What are the symptoms? How can one reproduce the problem?

When TTS is active and the tab containing Bookreader is muted (right click tab -> 'Mute site'), the TTS skips over passages rapidly which speeds through the book. When unmuted the current passage will begin reading normally.

Evidence / Screenshot (if possible)

Include evidence of the problem or provide a screenshot.

Expectation

What should be happening? What will it look like / how will it behave when fixed?

TTS will continue progressing at the same rate without audio when tab is muted.

Context

What operating system? What browser type and version?

Windows, Google Chrome 116.0.5845.188 (Official Build) (64-bit)

NOT an issue on Firefox

Proposal & Constraints

What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere?

Stakeholders

@-tag any stakeholders of this bug

sbwhitt avatar Sep 20 '23 17:09 sbwhitt

@cdrini I detected site mute in Chrome using AudioContext.state. The (window.AudioContext || window.webkitAudioContext)() ensures cross-browser support. If audioContext.state is 'suspended', I trigger a timeout. Right now, it's a fixed 5s per chunk, but the plan is to set it dynamically based on the number of words in each chunk and the read-aloud speed. This will ensure the highlighted chunk stays visible for the exact duration it takes to read. If the speed changes, the timeout should adjust accordingly to keep everything in sync. I also need to handle edge cases like muting/unmuting mid-chunk. Basic timeout logic works in Chrome. No issues in Firefox. Need to test other browsers. Is this a good approach to follow?

ananyakaligal avatar Mar 28 '25 07:03 ananyakaligal

I cannot reproduce this on Chrome + Windows. Muting the tab has no effect when I try to reproduce. Would someone be able to upload a video of what they're observing?

cdrini avatar Apr 01 '25 23:04 cdrini

@cdrini , I was able reproduce this on chrome+ windows as well as chrome+Linux

https://github.com/user-attachments/assets/3c7d6658-56c4-4c16-b3b3-cda3b6d93751

ananyakaligal avatar Apr 02 '25 05:04 ananyakaligal