From 463314ef2e7b24820ee4dabc6ef35bd79fc31e6d Mon Sep 17 00:00:00 2001 From: bel Date: Fri, 31 Mar 2023 21:23:07 -0600 Subject: [PATCH] almost --- git.d/tts.d | 2 +- server.sh | 70 +++++++++++++++++++---------------------------------- 2 files changed, 26 insertions(+), 46 deletions(-) diff --git a/git.d/tts.d b/git.d/tts.d index ad91c45..86b67db 160000 --- a/git.d/tts.d +++ b/git.d/tts.d @@ -1 +1 @@ -Subproject commit ad91c4547fdc40c9b1a5b71c80e11460c5ca5268 +Subproject commit 86b67db949e686ae570b73ede729f4efd3216044 diff --git a/server.sh b/server.sh index c048ba2..d2295ea 100644 --- a/server.sh +++ b/server.sh @@ -25,6 +25,7 @@ cleanup() { pkill -f mayhem-party pkill -f server-vm } +cleanup trap cleanup EXIT log() { @@ -47,10 +48,7 @@ _mayhem_party() { log launching mayhem-party ( source ./config.d/mayhem-party.d/env.env - while true; do - ./git.d/mayhem-party.d/mayhem-party - sleep 5 - done + ./git.d/mayhem-party.d/mayhem-party ) &> /tmp/mayhem-party.mayhem-party.log & } @@ -65,58 +63,40 @@ _tts() { _stt() { log stt pushd ./git.d/stt.d/rust-whisper.d/ - pip3 install ./requirements.txt - popd - return 1 - if ! python3 -m pip show PyAudio; then - sudo apt -y install \ - portaudio19-dev \ - python3-pyaudio \ - python3-pip \ - git \ - pulseaudio - sudo python3 -m pip install --no-cache-dir \ - git+https://github.com/openai/whisper.git \ - soundfile \ - PyAudio \ - SpeechRecognition \ - PyYAML - fi + pip3 install -r ./requirements.txt log launching stt + local device=$( + pactl list \ + | grep Monitor.Source \ + | grep -v hdmi \ + | awk "{print \$NF}" \ + | head -n 1 + ) + ( + echo "pcm.pulse_monitor {" + echo " type pulse" + echo " device $device" + echo "}" + echo "ctl.pulse_monitor {" + echo " type pulse" + echo " device $device" + echo "}" + ) | sudo tee /etc/asound.conf ( export HOME="$PWD/mnt.d/stt.d" mkdir -p "$HOME" cd "$HOME" - local device=$( - pactl list \ - | grep Monitor.Source \ - | grep -v hdmi \ - | awk "{print \$NF}" \ - | head -n 1 - ) - ( - echo "pcm.pulse_monitor {" - echo " type pulse" - echo " device $device" - echo "}" - echo "ctl.pulse_monitor {" - echo " type pulse" - echo " device $device" - echo "}" - ) | sudo tee /etc/asound.conf - cd ../../git.d/stt.d/whisper-2023 - export HOTWORDS=../../config.d/mayhem-party.d/v01.yaml@.users[].state.gm.alias + export HOTWORDS=../../../config.d/mayhem-party.d/v01.yaml@.users[].state.gm.alias export MIC_TIMEOUT=2 export URL=http://localhost:17071/gm/rpc/broadcastSomeoneSaidAlias?message={{hotword}} export HEADERS=say="Eye herd {{hotword}}" export MIC_NAME=pulse_monitor - export MODEL=tiny.en export DEBUG=true - while true; do - python3 ./hotwords.py - sleep 5 - done + export MODEL=tiny.en + export P=2 + python3 ./hotwords.py ) &> /tmp/mayhem-party.stt.log & + popd } _snap() {