gui dependent yeah sure whatever

master
bel 2023-04-01 11:17:08 -06:00
parent d908a91014
commit 8e6f23f49b
2 changed files with 23 additions and 10 deletions

@ -1 +1 @@
Subproject commit bb578e98f6a13978e2e9c02b03eb6c41f16fc17c
Subproject commit 63fe8e7e9e1c68fd3f284bac6666ae5e5f970b6b

View File

@ -73,23 +73,43 @@ _stt() {
if [ -n "$PIP" ]; then
pip3 install -r ../../git.d/stt.d/rust-whisper.d/requirements.txt
fi
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
for i in $(pactl list short modules | grep secret | cut -f1); do
pactl unload-module $i
done
name='my_secret_sink'
if ! pactl list | grep -q $name; then
pactl load-module module-null-sink sink_name=$name channels=1
pactl load-module module-remap-source master=$name.monitor source_name=shared-$name source_properties="device.description=shared-$name" channels=1
pactl load-module module-remap-source master=$name.monitor source_name=shared-$name source_properties="device.description=shared-$name" #channels=1
mic_name="$(pactl list | grep -A 100 Name:.$name.monitor | grep device.description.=. | head -n 1 | sed 's/.* = //' | tr -d '"') Monitor"
fi
read -p "pavucontrol to change input to $mic_name, ok? "
log launching stt
(
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="$mic_name"
export MIC_NAME="${MIC_NAME:-pulse_monitor}"
export MODEL=tiny.en
export P=2
while ! python3 ../../git.d/stt.d/rust-whisper.d/hotwords.py; do
@ -99,13 +119,6 @@ _stt() {
)
}
_snap() {
if ! which snap; then
sudo apt -y install snap
fi
snap "$@"
}
if [ "$0" == "$BASH_SOURCE" ]; then
main "$@"
fi