How to make TDSR work in WSL with NVDA

Published: 2024-04-03

In this post, I'll be showing you how to get TDSR running in WSL, speaking through NVDA. As you'll soon learn, this provides many improvements and features, and makes the overall console experience a hundred times more enjoyable.

Why?

NVDA's console support has some serious limitations for console power users:

ed
a
test
test2
test3
.
=

You'll notice with the review cursor that it printed "3", but NVDA never read it! This is apparently fixable by setting "Speak new text in Windows Terminal via" in NVDA's advanced settings to "UIA notifications", but that requires you to use Windows Terminal, which has its own issues, especially with TDSR. Pressing alt+anything re-reads the prompt, rendering TDSR completely worthless in WT. I reported this in January of 2023, but seemingly no one cares.

Getting started

Getting TDSR

cd to wherever you want your TDSR to live (I usually put mine in /home/quin), then run:

git clone https://github.com/tspivey/tdsr

Once it's cloned, cd tdsr, then pip install requirements.txt however you want. I'm using Debian, which complains about possibly breaking system packages when doing pip install outside a venv, so you either have to use --break-system-packages to install them globally, or just create a venv and make an alias that runs TDSR through the virtual environment's Python binary directly (what I typically do).

Getting a speech server

Tyler Spivey, the author of TDSR and a good friend of mine, has written multiple speech servers to make this possible. The most recent, and most public, being this Rust implementation. There are instructions in the readme for how to build it.

The speech server that I personally use, though, is this Python implementation, simply because it's what I started out using. The procedure for setting up either one of these is pretty much the same:

Making TDSR communicate with it

I wrote a basic shell script that opens a socket to the server:

#!/bin/sh

ip=$(ip route show | grep -i default | awk '{ print $3}')
exec socat - TCP4:$ip:64111,nodelay

Save this in your TDSR directory, and chmod +x it.

Running TDSR

To run it, use tdsr -s <name-of-sh-script>. I typically just put this as part of my alias, to make life easier.

If everything worked, you should hear TDSR start speaking!