master
bel 2023-03-31 21:23:07 -06:00
parent 84b7962acc
commit 463314ef2e
2 changed files with 26 additions and 46 deletions

@ -1 +1 @@
Subproject commit ad91c4547fdc40c9b1a5b71c80e11460c5ca5268 Subproject commit 86b67db949e686ae570b73ede729f4efd3216044

View File

@ -25,6 +25,7 @@ cleanup() {
pkill -f mayhem-party pkill -f mayhem-party
pkill -f server-vm pkill -f server-vm
} }
cleanup
trap cleanup EXIT trap cleanup EXIT
log() { log() {
@ -47,10 +48,7 @@ _mayhem_party() {
log launching mayhem-party log launching mayhem-party
( (
source ./config.d/mayhem-party.d/env.env source ./config.d/mayhem-party.d/env.env
while true; do ./git.d/mayhem-party.d/mayhem-party
./git.d/mayhem-party.d/mayhem-party
sleep 5
done
) &> /tmp/mayhem-party.mayhem-party.log & ) &> /tmp/mayhem-party.mayhem-party.log &
} }
@ -65,58 +63,40 @@ _tts() {
_stt() { _stt() {
log stt log stt
pushd ./git.d/stt.d/rust-whisper.d/ pushd ./git.d/stt.d/rust-whisper.d/
pip3 install ./requirements.txt pip3 install -r ./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
log launching stt 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" export HOME="$PWD/mnt.d/stt.d"
mkdir -p "$HOME" mkdir -p "$HOME"
cd "$HOME" cd "$HOME"
local device=$( export HOTWORDS=../../../config.d/mayhem-party.d/v01.yaml@.users[].state.gm.alias
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 MIC_TIMEOUT=2 export MIC_TIMEOUT=2
export URL=http://localhost:17071/gm/rpc/broadcastSomeoneSaidAlias?message={{hotword}} export URL=http://localhost:17071/gm/rpc/broadcastSomeoneSaidAlias?message={{hotword}}
export HEADERS=say="Eye herd {{hotword}}" export HEADERS=say="Eye herd {{hotword}}"
export MIC_NAME=pulse_monitor export MIC_NAME=pulse_monitor
export MODEL=tiny.en
export DEBUG=true export DEBUG=true
while true; do export MODEL=tiny.en
python3 ./hotwords.py export P=2
sleep 5 python3 ./hotwords.py
done
) &> /tmp/mayhem-party.stt.log & ) &> /tmp/mayhem-party.stt.log &
popd
} }
_snap() { _snap() {