gui dependent yeah sure whatever
This commit is contained in:
Submodule git.d/stt.d updated: bb578e98f6...63fe8e7e9e
31
server.sh
31
server.sh
@@ -73,23 +73,43 @@ _stt() {
|
|||||||
if [ -n "$PIP" ]; then
|
if [ -n "$PIP" ]; then
|
||||||
pip3 install -r ../../git.d/stt.d/rust-whisper.d/requirements.txt
|
pip3 install -r ../../git.d/stt.d/rust-whisper.d/requirements.txt
|
||||||
fi
|
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
|
for i in $(pactl list short modules | grep secret | cut -f1); do
|
||||||
pactl unload-module $i
|
pactl unload-module $i
|
||||||
done
|
done
|
||||||
name='my_secret_sink'
|
name='my_secret_sink'
|
||||||
if ! pactl list | grep -q $name; then
|
if ! pactl list | grep -q $name; then
|
||||||
pactl load-module module-null-sink sink_name=$name channels=1
|
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"
|
mic_name="$(pactl list | grep -A 100 Name:.$name.monitor | grep device.description.=. | head -n 1 | sed 's/.* = //' | tr -d '"') Monitor"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
read -p "pavucontrol to change input to $mic_name, ok? "
|
||||||
log launching stt
|
log launching stt
|
||||||
(
|
(
|
||||||
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 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="$mic_name"
|
export MIC_NAME="${MIC_NAME:-pulse_monitor}"
|
||||||
export MODEL=tiny.en
|
export MODEL=tiny.en
|
||||||
export P=2
|
export P=2
|
||||||
while ! python3 ../../git.d/stt.d/rust-whisper.d/hotwords.py; do
|
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
|
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||||
main "$@"
|
main "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user