master
parent
661a8c85f0
commit
87e12f8f52
|
|
@ -4,9 +4,6 @@
|
|||
[submodule "git.d/rusty-pipe.d"]
|
||||
path = git.d/rusty-pipe.d
|
||||
url = https://gogs.inhome.blapointe.com/bel/rusty-pipe.git
|
||||
[submodule "git.d/stt.d"]
|
||||
path = git.d/stt.d
|
||||
url = https://gogs.inhome.blapointe.com/bel/stt.git
|
||||
[submodule "git.d/tts.d"]
|
||||
path = git.d/tts.d
|
||||
url = https://gogs.inhome.blapointe.com/bel/tts.git
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 0805bb6fd83bf40f5a8d409037f90d1577ea9f57
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# /bin/bash
|
||||
|
||||
main() {
|
||||
trap cleanup exit
|
||||
log tts
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
kill -9 $(jobs -p)
|
||||
}
|
||||
|
||||
log() {
|
||||
echo "$(date) > $*" >&2
|
||||
}
|
||||
|
||||
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||
main "$@"
|
||||
fi
|
||||
131
server-vm.sh
131
server-vm.sh
|
|
@ -1,131 +0,0 @@
|
|||
# /bin/bash
|
||||
|
||||
main() {
|
||||
_discord
|
||||
_dolphin
|
||||
_stt
|
||||
_mayhem_party
|
||||
#while read; do
|
||||
# pkill -SIGUSR1 -f mayhem-party
|
||||
#done
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
pkill -f mayhem-party
|
||||
pkill -f hotwords.py
|
||||
pkill -f server-vm
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
log() {
|
||||
echo "$(date) > $*" >&2
|
||||
}
|
||||
|
||||
_discord() {
|
||||
if ps aux | grep -v grep | grep -v "server-vm.sh" | grep -i discord; then
|
||||
return
|
||||
fi
|
||||
if ! _snap info discord; then
|
||||
sudo snap install discord
|
||||
fi
|
||||
log launching discord
|
||||
snap run discord &> /tmp/mayhem-party.discord.log &
|
||||
disown
|
||||
}
|
||||
|
||||
_dolphin() {
|
||||
if ps aux | grep -v grep | grep -v "server-vm.sh" | grep -i dolphin; then
|
||||
return
|
||||
fi
|
||||
if ! _snap info dolphin-emulator; then
|
||||
sudo snap install dolphin-emulator --beta
|
||||
fi
|
||||
log launching dolphin
|
||||
snap run dolphin-emulator.dolphin-emu &> /tmp/mayhem-party.dolphin.log &
|
||||
disown
|
||||
}
|
||||
|
||||
_mayhem_party() {
|
||||
log dolphin
|
||||
if ! which mayhem-party; then
|
||||
sudo snap install go --classic
|
||||
export GOPATH="$HOME/Go"
|
||||
cd ./git.d/mayhem-party.d
|
||||
snap run go install
|
||||
test -f "$GOPATH/bin/mayhem-party" || log "did not install"
|
||||
fi
|
||||
log launching mayhem-party
|
||||
#(
|
||||
source ../../config.d/mayhem-party.d/env.env
|
||||
#while true; do
|
||||
export DEBUG=true
|
||||
"$HOME"/Go/bin/mayhem-party
|
||||
# sleep 5
|
||||
#done
|
||||
#) &
|
||||
#) &> /tmp/mayhem-party.mayhem-party.log &
|
||||
}
|
||||
|
||||
_stt() {
|
||||
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
|
||||
(
|
||||
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 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
|
||||
) &> /tmp/mayhem-party.stt.log &
|
||||
}
|
||||
|
||||
_snap() {
|
||||
if ! which snap; then
|
||||
sudo apt -y install snap
|
||||
fi
|
||||
snap "$@"
|
||||
}
|
||||
|
||||
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||
main "$@"
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue