7 Commits

Author SHA1 Message Date
bel
37050f3d87 test quiet mode 2023-03-26 10:06:22 -06:00
bel
74717609ec v01.yaml has .quiet=true to cause all button pushes to become releases 2023-03-26 10:00:10 -06:00
bel
24ae45896f todo 2023-03-26 09:57:03 -06:00
bel
8b29648c50 add hotwords file for stt 2023-03-26 09:55:50 -06:00
bel
1eba008efe readme order 2023-03-26 09:49:51 -06:00
bel
d48c545030 update host.README for tts and stt integrated 2023-03-26 09:47:19 -06:00
bel
323ca466ad update configs in host.d for tts 2023-03-26 09:29:02 -06:00
10 changed files with 77 additions and 12 deletions

View File

@@ -36,6 +36,14 @@ See `./config.d/rusty-pipe.d`
# Server
## TTS
`cd /home/breel/Go/src/gogs.inhome.blapointe.com/tts/larynx.d; bash run.sh`
## STT
`cd /home/breel/Go/src/gogs.inhome.blapointe.com/stt.d/whisper-2023; HOTWORDS=/home/breel/Go/src/gogs.inhome.blapointe.com/mayhem-party.d/host.d/config.d/stt.d/hotwords.txt MIC_TIMEOUT=2 URL=http://localhost:17071/ HEADERS=say='what fool said, {{hotword}}, when they said, {{context}}?' python3 ./hotwords.py'
## `mayhem-party`
### Configs
@@ -52,7 +60,3 @@ See `./config.d/rusty-pipe.d`
Foreground
## `stt`
TODO pipe stt detecting relevant strings -> change the `./config.d/mayhem-party.d/remap.d/live.yaml` link -> `SIGUSR1` to `mayhem-party`

View File

@@ -1,7 +1,11 @@
export DEBUG=true
export RAW_UDP=17070
export BUTTON_V01=true
export WRAP_REFRESH_ON_SIGUSR1=true
export MAIN_INTERVAL_DURATION=5ms
export RAW_UDP=17070
export PARSE_V01=true
export V01_CONFIG=./config.d/mayhem-party.d/v01.yaml
export WRAP_REFRESH_ON_SIGUSR1=true
export OUTPUT_KEYBOARD=false
export BUTTON_V01_CONFIG=./config.d/mayhem-party.d/v01.yaml

View File

@@ -1 +1 @@
players_offset_4.yaml
players_offset_2.yaml

View File

@@ -1,5 +1,6 @@
feedback:
addr: :17071
ttsurl: http://localhost:15002
users:
bel:
player: 2
@@ -19,3 +20,4 @@ players:
2: 6
3: 7
4: 8
quiet: false

View File

@@ -0,0 +1,5 @@
mario
party
yo
win
die

View File

@@ -12,4 +12,5 @@ type config struct {
Players []struct {
Transformation transformation
}
Quiet bool
}

View File

@@ -17,3 +17,4 @@ players:
b: "2"
x: "3"
y: "4"
quiet: false

View File

@@ -15,7 +15,7 @@ import (
var (
FlagDebug = os.Getenv("DEBUG") == "true"
FlagParseV01Config = os.Getenv("PARSE_V01_CONFIG")
FlagParseV01Config = os.Getenv("V01_CONFIG")
)
type (
@@ -60,7 +60,13 @@ func (v01 *V01) Read() []button.Button {
}
v01.telemetry(msg)
return v01.transform(msg).buttons()
buttons := v01.transform(msg).buttons()
if v01.cfg.Quiet {
for i := range buttons {
buttons[i].Down = false
}
}
return buttons
}
func (v01 *V01) telemetry(msg message) {

View File

@@ -1,6 +1,7 @@
package v01
import (
"context"
"testing"
)
@@ -49,3 +50,43 @@ func TestV01TransformationPipe(t *testing.T) {
})
}
}
func TestV01Quiet(t *testing.T) {
ctx, can := context.WithCancel(context.Background())
defer can()
v01 := NewV01(ctx, constSrc(`{"Y":"a", "N":"b"}`))
v01.cfg.Quiet = false
if got := v01.Read(); len(got) != 2 {
t.Error(len(got))
} else if got[0].Char != 'a' {
t.Error(got[0].Char)
} else if got[0].Down != true {
t.Error(got[0].Down)
} else if got[1].Char != 'b' {
t.Error(got[1].Char)
} else if got[1].Down != false {
t.Error(got[1].Down)
}
v01.cfg.Quiet = true
if got := v01.Read(); len(got) != 2 {
t.Error(len(got))
} else if got[0].Char != 'a' {
t.Error(got[0].Char)
} else if got[0].Down != false {
t.Error(got[0].Down)
} else if got[1].Char != 'b' {
t.Error(got[1].Char)
} else if got[1].Down != false {
t.Error(got[1].Down)
}
}
type constSrc string
func (c constSrc) Close() {}
func (c constSrc) Read() []byte {
return []byte(c)
}

View File

@@ -1,6 +1,5 @@
todo:
- https via home.blapointe and rproxy
- tts for when someone said the word via larynx docker + http.get + https://pkg.go.dev/github.com/faiface/beep@v1.1.0/wav
- endpoint for v01 to start read-only mode so when hotword spoken, players are dcd
without losing players; press a hotkey that is bound to dolphin emulator pause
- todo: rotation triggers
@@ -78,3 +77,5 @@ done:
- todo: endpoint for v01 to start read-only mode so when hotword spoken, players are
dcd without losing players
ts: Sat Mar 25 23:16:47 MDT 2023
- todo: tts for when someone said the word via larynx docker + http.get + https://pkg.go.dev/github.com/faiface/beep@v1.1.0/wav
ts: Sun Mar 26 09:57:02 MDT 2023