johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
5.26k stars 256 forks source link

FR - more control over read-aloud #1281

Open Jopp-gh opened 3 months ago

Jopp-gh commented 3 months ago

Is your feature request related to a problem? Please describe. Foliate's read-aloud-command doesn't know stops and continues to read forever, imo, that's just unbearable. Sadly, the only thing we can do to exit this loop is to kill Foliate.

Describe the solution you'd like if the read-aloud-command reads, Foliate's popup shoult add "stop reader" or replace "read from here". In addition, it would be great to have a setting to hear just sentences/paragraphs/one page. Not all books are for pleasure and so you need stops to understand what you read. Finally, I would welcome a shortcut to start and a shortcut to stop the read-aloud-command, maybe more comfortable than using a context menu.

Describe alternatives you've considered I tried to switch my screenreader off, but Foliate continues to read. I'm ok if Foliate is independent from my OS settings, the thing I'm complaining about is we currently have no way to control the start / stop of the screenreader in Foliate.

johnfactotum commented 3 months ago

You can stop, pause, or skip forward/backward (by paragraph) in the TTS popover. But this is indeed not obvious if one is initiating speech from the selection menu.

To fix this, it could show the navbar and somehow animate or highlight the headphones icon, or only show that icon, not the rest of the navbar, while playing.

Alternatively—this is probably the better option—it could replace the navbar with a permanent bar containing the playback controls, which would make them less laborious to use, and would not obstruct the content. The stop button, in this case, should probably make it return to the normal navbar state.

I tried to switch my screenreader off, but Foliate continues to read. I'm ok if Foliate is independent from my OS settings

Foliate uses speech-dispatcher, which has a server-client architecture. So ultimately the output is controlled by the server (i.e. the system), not the client (i.e. Foliate). You should be able to stop the output by sending messages to the server, e.g. with spd-say --cancel.

Jopp-gh commented 3 months ago

You can stop, pause, or skip forward/backward (by paragraph) in the TTS popover. But this is indeed not obvious if one is initiating speech from the selection menu.

Hmm, I didn't see this popover, maybe because I'm using piper voices? They sound great and you can get voices for many languages. I wouldn't use the default eSpeak / gSpeak - too hard to follow. Also, I'm new to Foliate, did check with care but couldn't find any skip forward/backward (by paragraph) buttons, not sure where I should look

To fix this, it could show the navbar and somehow animate or highlight the headphones icon, or only show that icon, not the rest of the navbar, while playing.

Well I think two shortcuts would be enough, but if you want, you could introduce one button to show the playing status:

  1. Play icon (reader off)
  2. Pause icon (reader on)

And maybe yet another button to stop, if really necessary.

Alternatively—this is probably the better option—it could replace the navbar with a permanent bar containing the playback controls, which would make them less laborious to use, and would not obstruct the content. The stop button, in this case, should probably make it return to the normal navbar state.

I like the minimalistic look and apparently none of the useful features is missing. Probably such a bar would be helpful.

Finally, I wanna highlight that reading speed is very important to learn new content. Maybe a slider button to change speed interactively would be amazing!

You should be able to stop the output by sending messages to the server, e.g. with spd-say --cancel.

Fantastic! I checked orca and other man pages also speech dispatcher but couldn't get how to build the right syntax. New stuff for me :)

johnfactotum commented 3 months ago

Hover on the footer, on the bottom of the page. It will show the navbar. Near the end of the navbar, there's a button with the headphones icon. Clicking on that button would show a popover that allows you to control TTS or media overlay playback.

image

Jopp-gh commented 3 months ago

I didn't expect an interactive status bar (facepalm), my fault!

Maybe the 'read from here' popup Command is a bit "misleading" and should be hidden by user preference or you add a "stop reading" in the same popup. I guess this latter option would be more useful. Thanks