edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.8k stars 154 forks source link

MacOS 11.2: Text-to-Speech not moving in epub #1395

Closed buerki closed 3 years ago

buerki commented 3 years ago

The Text-to-Speech function in both v. 1.6 and 1.6.1 alpha does not work on epub. It shows the frame (and the pause, skip forward and backward, and stop buttons at the top), but remains silent and does not move at all. Pressing the skip buttons does work, but no sound and it does not move on automatically. With PDFs, MacOS's own Text-to-Speech function can be activated and works fine, but with epub, it cannot be activated and the built-in Thorium Text-to-Speech button (microphone) does not seem to work as per description above. It would be great if this could be fixed.

danielweck commented 3 years ago

Hello, I am not able to reproduce this bug. Could you please privately share an EPUB that exhibits this behaviour? Thank you! :)

buerki commented 3 years ago

Thank you – indeed it seems 'read aloud' works with some epub files, but not others. This one, for example, doesn't work for me (no sound, highlight does not move). Where 'read aloud' works, I don't seem to be able to change the speech synthesiser to a different language – German language epub files are read by the same English voice, resulting in incomprehensible output. The overall language selection of the interface does not seem to make a difference. Is there a specific language setting for Text-to-Speech? Many thanks!

danielweck commented 3 years ago

On MacOS, you have to install additional language packs / TTS voices via System Preferences (Accessibility / Speech). Can you please check that you have compatible locales installed?

buerki commented 3 years ago

Yes, I have a couple of German voices installed (Anna and Yannick). The voice I hear when I use Thorium's readaloud is the 'Scottish Standard English Voice'.

danielweck commented 3 years ago

I suspect your EPUB has a missing or incorrect language attribute in the HTML documents. Can you please check? (I am happy to test at my end, if it helps)

buerki commented 3 years ago

Indeed! All troublesome files had either no language specified or the wrong one. Changing/adding it (lang="de") solved the problem. Many thanks! This fault seems to be widespread in epub files (some of these were from reputable publishers) – possibly an override function might be useful (issue #1130), but clearly it's the html tags that are at fault. Many thanks for your help. The issues with the readaloud highlight not moving and remaining silent has also disappeared.