General system TTS for games

Hi,

(I am very much a noob for context)

I am in a situation where I want to use TTS for various games to the point that it seems a better idea to set up a system wide tts running into a virtual mic. After a lot of tinkering I’ve managed to get one piper command working

echo “Hello, this is Ryan speaking” | /opt/piper-tts/piper --model /usr/share/piper-voices/en/en_US/ryan/medium/en_U
S-ryan-medium.onnx --output-raw | aplay -f S16_LE -r 22050

but to be honest I dont at all understand how. I followed this article https://gustawdaniel.com/notes/hot-to-setup-tts-on-arch-linux/ to get some of the way and followed random online advice/troubleshooting (plus some AI; i know its bad and not reliable but it can make things easier)

However, I don’t know where to go from here to make this a text box or similar I can type in to get tts and the command doesnt work with any other models.

My aim is for a text box that runs tts into a virtual mic for games etc.

Any help is greatly appreciated.

It’s straight forward. Echo text into piper-tts and play it. Point piper-tts to one of the piper-tts voices/models you downloaded. If you’re on KDE you can just do

kdialog --textinputbox "TTS" | piper --model ...

to put a text box in front of it. Or alternatively check out dsnote in the AUR, which packages everything in a neat application.

Hi,

So I tried the command where both piper and kdialog commands werent recognised.

I also tried dsnote and downloaded a couple models but that didnt seem to work either; read flashed and then didnt work and listen didnt seem to be working either; picked up one word incorrectly from a couple lines of text.

do you have any advice/info?

Thanks for the help so far.

Depends on what you did and what the actual error is. Are you on kde, do you have kdialog installed? How did you install piper, and is it piper for you (here the binary is piper-tts)?

The dsnote AUR version works fine here. Maybe try the flatpak?