Userscript for Text-to-Speech playback in Chromium Reader Mode

Hi,

I’m looking for a solution to improve my convenience. I like to listen to audio news, and one of the issues (not to be solved here) is the limited amount of content matching my interests. So, I would like to find a way to convert text to speech.

My idea (which I wouldn’t be able to program myself, but the technique is understandable): the Chromium browser has a reader mode that displays the article without distractions. A JavaScript userscript could run in this environment, send the text to an external service (e.g., OpenAI ChatGPT) with a conversion request, and then offer the resulting sound file for playback. It would be nice to have a playback speed selector (0.5×, 0.75×, … 2.0×).

  • Is there an app or simple way to have the browser read web pages aloud?
  • Would you find it useful if a web page could be turned into an audio file automatically?

Regain your privacy! Adopt /e/OS the deGoogled mobile OS and online services

I have this in Firefox Android (available for Chrome-based browsers too):

in Sherpa-TTS I have the languages downloaded I can understand (each 60MB) and set as system service (replacing PicoTTS set in Settings).

Then from the browser Read-Aloud is set to Auto and it picks up the right language depending on article. FF has a reader-mode too for Text isolation. The RL shortcut is behind Settings → Extensions → Read-Aloud.

The Piper voices are pretty good, big step for offline voice - all device local, works in other Apps (OrganicMaps etc) - recommended.

2 Likes

You have just doubled the level of your karma points.

as linked, it was @MRTN that made me aware of onnx, Piper / coqui voices and their Android integration through Sherpa. Here’s a page where you can give them all a try without downloading the voice model:

makes a difference to me if it’s news (matter of fact voice) or a book. I’d love for Firefox Android to allow Extension icon placement in the UI to reduce it to one touch. You can also make a voice of your favourite person to read you the news, takes a bit of time to make recordings though :slight_smile:

1 Like