Files
dotfiles/home-modules/tts.nix
Lennart J. Kurzweg (Nx2) d2d1ce7830 overlays refactor
2025-06-17 19:48:31 +02:00

18 lines
470 B
Nix

{ pkgs, ... }@all: with all;
{
home.packages = with pkgs; [
(writeShellApplication {
name = "ttss";
text = let
cmd = inp: "piper -m /home/nx2/tts/en_GB-cori-high.onnx --output_raw ${inp} | ffmpeg -hide_banner -loglevel error -f s16le -ar 22050 -ac 1 -i - -f wav - | mpv -";
in /* bash */ ''
if [ -p /dev/stdin ]; then
${cmd "</dev/stdin"}
else
${cmd ''<<< "$@"''}
fi
'';
})
];
}