tts
This commit is contained in:
18
home-modules/tts.nix
Executable file
18
home-modules/tts.nix
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
{ pkgs, lib, user, ... }:
|
||||||
|
lib.mkIf (user != "tv")
|
||||||
|
{
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user