Perl-Einzeiler#
Ausgangspunkt für diese Sammlung ist der Hinweis durch User "Tigran" am 27.09.2025 auf das Buch
"Perl One-Liners Guide" von Sundeep Agarwal im perlweekly-newsletter.
Sprachausgabe#
Semilong Perl-Oneliner-TTS-Example for alsa-utils and (https://github.com/rhasspy/piper or "yay -S piper-voices-en-gb" with arch/manjaro-linux), that plays all found voices that contain one speaker and text "there is no business like show-business":
perl -MFile::Find -E'my $text="There is no business like show business";say $text;find(sub {if (/onnx$/){say $_;open TTS, "|piper-tts -m ".$File::Find::name." -q -f -|aplay -t wav -f S16_LE -r 22050 -c 1 -q";print TTS $text;close TTS}}, "/usr/share/piper-voices")'
Übersetzung auf lokalem Rechner#
Here is another oneliner for translating into spanish ("es") with libretranslate as a docker-installation as described in https://docs.libretranslate.com/guides/installation: "mojo" is short for "perl -Mojo ...":
mojo get -M POST -r -H 'Content-Type: application/json' -c '{"q":"There is more than one way to do it","source":"auto","target":"es"}' http://localhost:5000/translate /translatedText
To hear this with gtts-cli and alsa-utils in arch-linux, you can append:
|gtts-cli -s -l es -|play -t mp3 -
Zuhörer#
ToDo: Jetzt fehlt nur noch ein Zuhörer z.B. in Form von "whisper", der dann mit einem Oneliner aufgefordert wird, Offline-Smarthome-Kommandozentrale per Sprache zu werden.
So wie es heute schon seit vielen Jahren dieses "Voldemord-Gerät" von einem berühmten Onlineversand online praktiziert.
Siehe auch FROSCON-Vortrag 2025 "A...xa ohne Cloud"