Crates.io | bmos_client |
lib.rs | bmos_client |
version | 1.0.1 |
source | src |
created_at | 2021-07-16 15:24:09.71127 |
updated_at | 2021-07-16 15:53:20.775153 |
description | bmOS_client is an executable in charge of receiving and parsing JSON input from stdin and sending intents with enough confidence (>0.6) to the address and port provided (to bmOS_server). This is part of the software required to run a custom BMO-Boy. |
homepage | |
repository | |
max_upload_size | |
id | 423674 |
size | 48,964 |
bmOS_client is an executable in charge of receiving and parsing JSON input from stdin and sending intents with enough confidence (>0.6) to the address and port provided (to bmOS_server). This is part of the software required to run my custom BMO-Boy. Images and a blog post are coming soon.
bmOS_client expects JSON strings with the format specified here, and looks for the intent's name and confidence, sending it if the confidence's enough.
Everything is designed around voice2json as the source of intent recognition. The documentation is available here. The best results have been obtained with the default profiles, both in English and Spanish, though one should expect a moderate amount of false positives if the environment is noisy. Below is an example of a barebones sentences.ini file (which is the only modification I did on the downloaded profiles):
[hello]
hi beemo
hello beemo
[song]
play a song beemo
[sad]
you are ugly beemo
[angry]
i hate you beemo
[surprise]
surprise beemo
[chronometer]
start a chronometer beemo
give me a chronometer beemo
[5more]
give it (five | 5) minutes more
[10more]
give it (ten | 10) minutes more
[20more]
give it (twenty | 20) minutes more
[5less]
take (five | 5) minutes less
[10less]
take (ten | 10) minutes less
[20less]
take (twenty | 20) minutes less
[done]
it is done beemo
i have finished beemo
Below is an example of a bash script which sets up audio streaming from bmOS_server's host, receives it on the local host running bmOS_client and pipes it through voice2json up to stdout (which should then be piped to bmOS_client)
ssh pi@[ip_address_here] "rec -c 2 -t wav -" | sox - -d -t raw -r 22.05k -b 8 - gain -5 | sudo ./voice2json.bash --profile /profile/ transcribe-stream --audio-source - | sudo ./voice2json.bash --profile /profile/ recognize-intent
Where voice2json.bash contains a script to fire up voice2json's docker container, where en-us_kaldi-zamia is the name of the profile used, and should be changed to whichever is in use:
docker run -i \
--init \
-v "[path_to_local_dir]/voice2json/profile:/profile/" \
-v "[path_to_local_dir]/voice2json/profile:/root/.local/share/voice2json/en-us_kaldi-zamia/" \
-w "$(pwd)" \
-e "HOME=${HOME}" \
s