13 Commits

Author SHA1 Message Date
bel
3a36333ef6 DOCKERFILE A GOGO 2023-03-28 20:05:14 -06:00
bel
b2654a10b2 IT RUNS DOCKER but stt accepts emptystrings and doesnt mount and those are bad 2023-03-28 19:57:45 -06:00
bel
2a3b013353 add signing exe 2023-03-28 19:31:00 -06:00
Bel LaPointe
3c9a01d3d9 dockerfile todo 2023-03-28 15:43:08 -06:00
Bel LaPointe
8ab758a5cc dockerfile at least can run stt though not sure how to pipe audio into it 2023-03-28 15:41:22 -06:00
Bel LaPointe
c3130e7a00 dockerfile comment 2023-03-28 11:27:11 -06:00
Bel LaPointe
febed803e9 stt up 2023-03-28 11:26:06 -06:00
Bel LaPointe
0b55e46bc1 dockerfile continues 2023-03-28 11:21:25 -06:00
Bel LaPointe
af8f75bc7c stub dockerfile and cmd is nicer than entrypoint til 2023-03-28 07:49:32 -06:00
Bel LaPointe
4652ed623b readme on how2 submodules and pull 2023-03-28 07:27:03 -06:00
bel
7d9bf4133d whoops one more 2023-03-27 21:42:41 -06:00
bel
5e21ca40fc upgrade to mvp i think 2023-03-27 21:41:40 -06:00
bel
ac3342790c git pull origin master for each subm 2023-03-27 20:19:27 -06:00
14 changed files with 135 additions and 37 deletions

3
.gitignore vendored
View File

@@ -0,0 +1,3 @@
/mnt.d
**/*.sw*
**/__pycache__

47
Dockerfile Normal file
View File

@@ -0,0 +1,47 @@
FROM golang:bullseye as mayhem-party-builder
WORKDIR /mayhem-party.d
RUN apt -y update && apt -y install libasound2-dev
COPY git.d/mayhem-party.d/ ./
RUN go build -o /bin/mayhem-party
FROM debian:stable-slim
RUN apt -y update && apt -y upgrade && apt -y install wget
# tts
RUN \
wget https://github.com/rhasspy/larynx/releases/download/v1.1/larynx-tts_1.1.0_amd64.deb \
&& apt -y install ./larynx-tts_1.1.0_amd64.deb \
&& rm ./larynx-tts_1.1.0_amd64.deb
# https://stackoverflow.com/questions/28985714/run-apps-using-audio-in-a-docker-container
# stt #nogo since i need microphone #wait no i dont, i just need to set env or dont start
RUN \
apt -y install portaudio19-dev python3-pyaudio python3-pip git \
&& python3 -m pip install \
git+https://github.com/openai/whisper.git \
soundfile \
PyAudio \
SpeechRecognition
RUN python3 -m pip install PyYAML
RUN apt install -y pulseaudio
COPY ./git.d/stt.d/ /stt.d/
# sigusr1
# mayhem-party
COPY --from=mayhem-party-builder /bin/mayhem-party /bin/mayhem-party
# configs
COPY ./config.d/ /config.d/
# entrypoint
RUN echo 'date' > /entrypoint.sh \
&& echo 'cleanup() { kill -9 $(jobs -p); wait; }; trap cleanup EXIT' >> /entrypoint.sh \
&& echo '( export HOME=/mnt/tts.d; mkdir -p "$HOME"; cd "$HOME"; while true; do larynx-server --port 15002; sleep 5; done ) &' >> /entrypoint.sh \
&& echo '( export HOME=/mnt/stt.d; mkdir -p "$HOME"; cd "$HOME"; while true; do cd /stt.d/whisper-2023; HOTWORDS=/config.d/mayhem-party.d/v01.yaml@.users[].state.gm.alias MIC_TIMEOUT=2 URL=http://localhost:17071/gm/rpc/broadcastSomeoneSaidAlias?message={{hotword}} HEADERS=say="Eye herd {{hotword}}" MIC_NAME=pulse python3 ./hotwords.py; sleep 5; done ) &' >> /entrypoint.sh \
&& echo 'echo running mayhem party; source /config.d/mayhem-party.d/env.env; if ! /bin/mayhem-party; then echo mayhem-party failure; exit 1; fi' >> /entrypoint.sh
ENTRYPOINT []
CMD ["bash", "/entrypoint.sh"]

View File

@@ -1,5 +1,7 @@
# Mayhem Party Venue # Mayhem Party Venue
`git submodule init; git pull --recurse-submodules --jobs=10; git submodule foreach git pull origin master`
# Clients # Clients
## Distribute `rusty-pipe` ## Distribute `rusty-pipe`
@@ -14,7 +16,13 @@
sudo apt install mingw-w64 sudo apt install mingw-w64
rustup target add x86_64-pc-windows-gnu rustup target add x86_64-pc-windows-gnu
echo windows echo windows
cargo build --release --target x86_64-pc-windows-gnu && ls target/x86_64-pc-windows-gnu/release/rusty-pipe.exe cargo build --release --target x86_64-pc-windows-gnu
rm target/x86_64-pc-windows-gnu/release/rusty-pipe-signed.exe
read -p ".crt? " CERT
osslsigncode sign \
-certs ${CERT%.crt}.crt -key ${CERT%.crt}.key \
-n Rusty-Pipe -i https://whois.home.blapointe.com \
-in target/x86_64-pc-windows-gnu/release/rusty-pipe.exe -out target/x86_64-pc-windows-gnu/release/rusty-pipe-signed.exe
echo local echo local
cargo install --path ./ cargo install --path ./
``` ```
@@ -27,13 +35,19 @@ See `./config.d/rusty-pipe.d`
# Server # Server
### Docker
```bash
docker build -f Dockerfile -t mayhem-party-venue . && docker run -p 17070-17071:17070-17071 --rm -it -v /run/user/$UID/pulse/native:/run/user/0/pulse/native -e PULSE_SERVER=unix:/run/user/0/pulse/native -v "$PWD"/mnt.d:/mnt mayhem-party-venue
```
## TTS ## TTS
`cd ./git.d/tts.d/larynx.d; bash run.sh` `cd ./git.d/tts.d/larynx.d; bash run.sh`
## STT ## STT
`cd ./git.d/stt.d/whisper-2023; HOTWORDS=../../../config.d/mayhem-party.d/v01.yaml@.users[].message MIC_TIMEOUT=2 URL=http://localhost:17071/config HEADERS=say='Eye herd {{hotword}}' BODY='[{"op":"replace", "path":"/Quiet", "value":true},{"op":"remove","path":"/Users/bel/Message"},{"op":"remove","path":"/Users/zach/Message"},{"op":"remove","path":"/Users/chase/Message"},{"op":"remove","path":"/Users/mason/Message"},{"op":"remove","path":"/Users/nat/Message"},{"op":"remove","path":"/Users/roxy/Message"},{"op":"remove","path":"/Users/bill/Message"}]' python3 ./hotwords.py' `cd ./git.d/stt.d/whisper-2023; HOTWORDS=../../../config.d/mayhem-party.d/v01.yaml@.users[].state.gm.alias MIC_TIMEOUT=2 URL=http://localhost:17071/gm/rpc/broadcastSomeoneSaidAlias?message={{hotword}} HEADERS=say='Eye herd {{hotword}}' python3 ./hotwords.py`
## `mayhem-party` ## `mayhem-party`

View File

@@ -3,11 +3,38 @@ feedback:
ttsurl: http://localhost:15002 ttsurl: http://localhost:15002
users: users:
bel: bel:
meta:
lasttsms: 1680052450309
lastlag: 676
state:
player: 2 player: 2
message: "" message: ""
gm:
alias: ""
lastalias: ""
vote: broadcast
broadcast: broadcast:
meta:
lasttsms: 0
lastlag: 0
state:
player: 0 player: 0
message: "8" message: <<SOMEONE SAID "{{HOTWORD}}">>
gm:
alias: ""
lastalias: ""
vote: ""
zach:
meta:
lasttsms: 1679978514018
lastlag: 0
state:
player: 0
message: ""
gm:
alias: ""
lastalias: ""
vote: ""
players: players:
- transformation: {} - transformation: {}
- transformation: - transformation:

View File

@@ -6,10 +6,11 @@ streams:
gui: gui:
user: bel user: bel
feedback: feedback:
url: http://mayhem-party.home.blapointe.com:17071?user=bel url_read: http://mayhem-party.home.blapointe.com:17071?user=bel
press: {prefix: "", suffix: ""} url_say: http://mayhem-party.home.blapointe.com:17071?user=bel&say=
release: {prefix: "", suffix: ""} url_send: http://mayhem-party.home.blapointe.com:17071/gm/rpc/vote?user=bel&payload=
format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' release_prefix: ""
format_keys: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}'
buttons: buttons:
up: 'w' up: 'w'
down: 's' down: 's'

View File

@@ -6,10 +6,11 @@ streams:
gui: gui:
user: zach user: zach
feedback: feedback:
url: http://mayhem-party.home.blapointe.com:17071?user=zach url_read: http://mayhem-party.home.blapointe.com:17071?user=zach
press: {prefix: "", suffix: ""} url_say: http://mayhem-party.home.blapointe.com:17071?user=zach&say=
release: {prefix: "", suffix: ""} url_send: http://mayhem-party.home.blapointe.com:17071/gm/rpc/vote?user=zach&payload=
format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' release_prefix: ""
format_keys: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}'
buttons: buttons:
up: 'w' up: 'w'
down: 's' down: 's'

View File

@@ -6,10 +6,11 @@ streams:
gui: gui:
user: chase user: chase
feedback: feedback:
url: http://mayhem-party.home.blapointe.com:17071?user=chase url_read: http://mayhem-party.home.blapointe.com:17071?user=chase
press: {prefix: "", suffix: ""} url_say: http://mayhem-party.home.blapointe.com:17071?user=chase&say=
release: {prefix: "", suffix: ""} url_send: http://mayhem-party.home.blapointe.com:17071/gm/rpc/vote?user=chase&payload=
format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' release_prefix: ""
format_keys: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}'
buttons: buttons:
up: 'w' up: 'w'
down: 's' down: 's'

View File

@@ -6,10 +6,11 @@ streams:
gui: gui:
user: mason user: mason
feedback: feedback:
url: http://mayhem-party.home.blapointe.com:17071?user=mason url_read: http://mayhem-party.home.blapointe.com:17071?user=mason
press: {prefix: "", suffix: ""} url_say: http://mayhem-party.home.blapointe.com:17071?user=mason&say=
release: {prefix: "", suffix: ""} url_send: http://mayhem-party.home.blapointe.com:17071/gm/rpc/vote?user=mason&payload=
format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' release_prefix: ""
format_keys: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}'
buttons: buttons:
up: 'w' up: 'w'
down: 's' down: 's'

View File

@@ -6,10 +6,11 @@ streams:
gui: gui:
user: nat user: nat
feedback: feedback:
url: http://mayhem-party.home.blapointe.com:17071?user=nat url_read: http://mayhem-party.home.blapointe.com:17071?user=nat
press: {prefix: "", suffix: ""} url_say: http://mayhem-party.home.blapointe.com:17071?user=nat&say=
release: {prefix: "", suffix: ""} url_send: http://mayhem-party.home.blapointe.com:17071/gm/rpc/vote?user=nat&payload=
format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' release_prefix: ""
format_keys: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}'
buttons: buttons:
up: 'w' up: 'w'
down: 's' down: 's'

View File

@@ -6,10 +6,11 @@ streams:
gui: gui:
user: roxy user: roxy
feedback: feedback:
url: http://mayhem-party.home.blapointe.com:17071?user=roxy url_read: http://mayhem-party.home.blapointe.com:17071?user=roxy
press: {prefix: "", suffix: ""} url_say: http://mayhem-party.home.blapointe.com:17071?user=roxy&say=
release: {prefix: "", suffix: ""} url_send: http://mayhem-party.home.blapointe.com:17071/gm/rpc/vote?user=roxy&payload=
format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' release_prefix: ""
format_keys: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}'
buttons: buttons:
up: 'w' up: 'w'
down: 's' down: 's'

View File

@@ -6,10 +6,11 @@ streams:
gui: gui:
user: bill user: bill
feedback: feedback:
url: http://mayhem-party.home.blapointe.com:17071?user=bill url_read: http://mayhem-party.home.blapointe.com:17071?user=bill
press: {prefix: "", suffix: ""} url_say: http://mayhem-party.home.blapointe.com:17071?user=bill&say=
release: {prefix: "", suffix: ""} url_send: http://mayhem-party.home.blapointe.com:17071/gm/rpc/vote?user=bill&payload=
format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' release_prefix: ""
format_keys: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}'
buttons: buttons:
up: 'w' up: 'w'
down: 's' down: 's'