Kira's Web-Treehouse for Plants ๐ŸŒฑ

& Other Wayward Beings

๐Ÿ‘๏ธ Eye Accessibility Hacks

Since February 2025 my eyes started experiencing great pain if I use them for more than a short period of time. As a result, I've had to keep my eyes closed for > 80% of each day.

It's been incredibly difficult, frustrating, and lonely. I hope it improves some day. One result of this disability is that I stopped being able to read websites or even local files like text files and PDFs. I'm mostly only able to take in audio, but I can handle very short bits of text, like instant messages or brief emails. I really wanted a way to still enjoy articles and other writings.

Using my limited daily eyesight, I slowly researched & then hacked together some programs to build utilities for myself that enable me to read PDFs and websites without needing my eyes: by turning them into audio I can listen to.

It felt really important to me to use local-first (no cloud crap), open source software. A lot of the older open source text-to-speech programs were not very good, and too difficult for me to understand.

Whisper has a really good synthesizer, but it takes my computer a LONG time to generate any audio. I eventually found Mozilla's TTS, which has a good generation time trade-off against quality.

I run Debian Linux, so some of the notes below may need to be adjusted to your system.

pdftotext

Converts a PDF to plain text.

The program comes with the poppler-utils package on Debian.

Invoke as

pdftotext quux.pdf -

to write the resultant text to stdout.

readability-scrape

Converts a URL into plain text.

https://github.com/aarmea/readability-scrape

This is a small Node.js program that uses Mozilla's Readability.js library (same thing Reader View in Firefox uses) to extract just the article text, given a website URL.

Invoke as

readability-scrape $URL

and it will write the text to stdout.

Mozilla TTS

Converts plain text to an WAV audio file.

https://github.com/mozilla/TTS/tree/dev#install-tts

I needed to install Python 3.10.x specifically for it to work properly, despite what the installation instructions say. I used pyenv for this.

I also to ensure certain system packages were installed:

After it's installed, here's how I invoke it:

tts --text \"$TEXT\" --out_path audio.wav

Tying it all together: lesen

I wrote a bash script called lesen (German for "to read"), which takes plain text on stdin, writes the audio to a specified file, and starts up a media player playing it when it's done.

e.g.

pdftotext rfc9110.pdf | lesen rfc.ogg

This will turn the PDF text into audio (as a WAV file), transcode it to OGG (much much smaller), and starts up the MPV media player playing it.

The script depends on a few programs:

#!/bin/bash

set -e

if [[ $# -ne 1 ]]; then
  echo "USAGE: $0 OUT < FILE"
  exit 1
fi

TEMP_OUT=$(mktemp)

TEXT=""
while read line; do
  TEXT+="$line"
done

tts --text \"$TEXT\" --out_path $TEMP_OUT 2> /dev/null > /dev/null"
ffmpeg -i $TEMP_OUT $1
rm $TEMP_OUT
mpv --pause $1