mike,
@mike@fosstodon.org avatar

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 -

dev_ric,
@dev_ric@fosstodon.org avatar

@mike if it increases productivity, it's not lazy 👍

MobileOak,
@MobileOak@fosstodon.org avatar

@mike what does the python part do?

mike,
@mike@fosstodon.org avatar

@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.

golemwire,

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

mike,
@mike@fosstodon.org avatar

@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 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 setup. And who doesn't love having Popey read your news to you?

@MobileOak

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • ngwrru68w68
  • Youngstown
  • cisconetworking
  • slotface
  • everett
  • rosin
  • Durango
  • kavyap
  • tacticalgear
  • mdbf
  • provamag3
  • thenastyranch
  • normalnudes
  • tester
  • modclub
  • khanakhh
  • ethstaker
  • cubers
  • osvaldo12
  • megavids
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines