@pito so I have mine working… have a look
another dockerable container that does all the audio flows
mic->hw->asr —> to tts–snd for test)
my need is to get triggered when hotword is detected and get the text spoken after that
so I have a socketio server which the container connects to and will emit those events when they happen
today there is a backgroud JS app started which does all that , spinning the mic/snowboy/asr to emits on stdout read by the node code…
no doc yet, and still a few bumps…
git clone GitHub - sdetweil/wyoming-sonus: wyoming voice control to replace sonus under smart-mirror
script/setup to get all the python stuff installed
example run
script/run --config=./sonushandler/config.json --debug
config.json points to where the other services are, and have settings to customize them
the docker-compose for starting this
version: "3.8"
services:
#
# this is audio in
#
microphone:
image: "$mic_image"
ports:
- "10600:10600"
devices:
- /dev/snd:/dev/snd
group_add:
- audio
command:
- "--device"
- "$mic_device"
#
# this is audio out
#
playback:
image: "$play_image"
ports:
- "10601:10601"
devices:
- /dev/snd:/dev/snd
group_add:
- audio
command:
- "--device"
- "$play_device"
#
# these are wakeword services, select one
#
openwakeword:
image: "rhasspy/wyoming-openwakeword"
ports:
- "10400:10400"
volumes:
- $HOME/$SMPATH/services/data/ww/openwakeword:$wakeword_config_folder
command:
- "--preload-model"
- "ok_nabu"
- "-custom-model-dir"
- "$wakeword_config_folder"
snowboy:
image: "rhasspy/wyoming-snowboy"
ports:
- "10400:10400"
volumes:
- $HOME/$SMPATH/services/data/ww/snowboy:$wakeword_config_folder
command:
- "--sensitivity"
- "0.5"
- "--data-dir"
- "$wakeword_config_folder"
- "--debug"
porcupine:
image: "rhasspy/wyoming-porcupine1"
ports:
- "10400:10400"
volumes:
- $HOME/$SMPATH/services/data/ww/porcupine:$wakeword_config_folder
command:
- "--sensitivity"
- "0.5"
- "--system"
- "$SYSTEM_TYPE"
- "--data-dir"
- "$wakeword_config_folder"
#
# these are speech to text (stt), select one
#
asr_google:
image: $asr_google_image
ports:
- "10555:10555"
volumes:
- $HOME/$SMPATH/services/data/asr/google:/config
#
# these are text to speech (tts)
#
tts_piper:
image: rhasspy/wyoming-piper
ports:
- "10200:10200"
volumes:
- $HOME/$SMPATH/services/data/tts/piper:/data
command:
- "--voice"
- "en_US-lessac-medium"
#
# this is the coordinator
#
sonus:
image: $sonus_image
#ports:
# - "$sonus_app_port:8080"
volumes:
- $HOME/$SMPATH/services/data:$sonus_config_path
command:
- "--config"
- "$sonus_config_path/$sonus_config_file"
- "--socket_address"
- "$sonus_app_address"
depends_on:
# audio in
- microphone
# hotword
- snowboy
# speech to text
- asr_google
# tect to speech
- tts_piper
# audio play out
- playback
and the .env file in the same folder that docker-compose will use
SMPATH=temp/sssss/smart-mirror
SYSTEM_TYPE=Linux
# play
#play_image=3399c39ea9a9
play_image=wyoming_snd_external:latest
play_device=plughw:0,8
# mic
#mic_image=3a09c0bb8f9c
mic_image=rhasspy/wyoming-mic-external:latest
mic_device=plughw:1,0
asr_google_image=wyoming-google:1.0.0
sonus_image=rhasspy/wyoming-sonus:latest
sonus_app_address=http://sams:$sonus_app_port
sonus_config_path=/config
sonus_config_file=/config.json
wakeword_config_folder=/custom
I built all the components locally to test out and see what was going on… used the local image id or name (in the env file)
then sonus: service is this github project
so I will have a nodejs app that configures the compose and config file
and talk to the sonus container to get notices of hotword and text
and also allow smart-mirror plugins to send text to be spoken over the socketio.
right now it speaks the text out of the asr after Syntheazsing the audio
you can compose up which ever services you want
docker-compose -f smart-mirror-services.yml up microphone playback asr_google tts_piper snowboy
while I have been developing…
the asr_google speech reco is here GitHub - sdetweil/wyoming-google
found a bug in mic (doesn’t stop the recorder when the client disconnects)
then when the client reconnects, oops, recorder won’t start (device in use) . so you have to cycle the mic container between tests
i stole the task processors from satellite and added more for asr/tts and snd
all the workflow work is done in handle_event