feat(speech): the speech capability over Cap'n Web, behind a gate
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The agent's ears and voice: a server on the home server transcribes a clip (sox, whisper.cpp) and speaks text (piper), one job at a time. A gate hands the capability to whoever presents its key; the key comes from systemd's credentials, not argv. make test runs the unit tests in Nix's sandbox; make smoke starts a real server on localhost, speaks a phrase, and hears it back. Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
646dfee4c6
commit
429bafe9c0
20 files changed
+621
No files matched your search
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# hear.sh MODEL: a WAV clip on stdin, whisper's transcript on stdout.
|
||||
# The Nix build fills in @sox@ and @whisper@ (server.nix).
|
||||
set -eu
|
||||
model=$1
|
||||
tmp=$(mktemp -d)
|
||||
trap 'rm -rf "$tmp"' EXIT
|
||||
cat > "$tmp/in.wav"
|
||||
# mono, 16-bit, normalized: the box's mics are quiet (speech peaks near -27 dBFS)
|
||||
@sox@/bin/sox "$tmp/in.wav" -r 16000 -c 1 -b 16 "$tmp/clip.wav" remix - gain -n -3
|
||||
@whisper@/bin/whisper-cli -m "$model" -f "$tmp/clip.wav" -t 4 -nt -np 2>"$tmp/err" \
|
||||
|| { cat "$tmp/err" >&2; exit 1; }
|
||||
Reference in new issue
Block a user