Yes, I'm actually this lazy.

#!/usr/bin/bash

INPUT_FILE=$1

if [ ! -f ${INPUT_FILE} ]
then
echo "File ${INPUT_FILE} doesn't exist. Please try again."
exit 1
fi

cat ${INPUT_FILE} |python3 -m piper --model en_GB-alan-medium --output-raw | aplay -r 22050 -f S16_LE -t raw -

@MobileOak It's a call to the piper tts engine that converts the provided file (should be text) to audio. The shell script that code is from is called read2me on my system, so I just type read2me file.txt and it reads the file out loud.

Follow

@mike @MobileOak Wouldn't spd-say or espeak work? Spd-say is pre-installed on a lot of Linux systems.

@golemwire I'm not familiar with spd-say, but espeak absolutely would. I'll assume they both would. I'm just more familiar with piper. I played around a lot with the old #Mycroft assistant, both on dedicated hardware and running on my computer. It used Mimic for it's TTS. It's primary developer was Michael Hansen, who also developed Piper. It's also the engine that's built into my #HomeAssistant setup. And who doesn't love having Popey read your news to you?

@MobileOak

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml