# The speech server and clients, with node, and the sox, whisper, and piper the server's scripts use. # bin/speech-server HOST PORT MODEL VOICE [PIPER_OPTION...] # bin/hear-client URL < clip.wav # bin/speak-client URL < text > speech.wav { callPackage, runCommand, nodejs-slim, sox, whisper-cpp, piper-tts }: let js = callPackage ./default.nix { }; dir = "${js}/lib/node_modules/pdtv26-speech"; in runCommand "pdtv26-speech" { } '' mkdir -p $out/bin substitute ${./hear.sh} $out/bin/hear.sh --subst-var-by sox ${sox} --subst-var-by whisper ${whisper-cpp} substitute ${./speak.sh} $out/bin/speak.sh --subst-var-by piper ${piper-tts} chmod +x $out/bin/hear.sh $out/bin/speak.sh cat > $out/bin/speech-server < $out/bin/$c done chmod +x $out/bin/speech-server $out/bin/hear-client $out/bin/speak-client ''