Skip to content

Commit

Permalink
Merge pull request #522 from alexylem/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
alexylem authored Apr 2, 2017
2 parents 216b342 + 4f16eb3 commit b2ac6a4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ hooks/start_speaking
hooks/stop_speaking

*.pyc

hooks/listening_timeout
1 change: 1 addition & 0 deletions hooks/listening_timeout.default
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$verbose && jv_debug "DEBUG: listening_timeout hook"
5 changes: 4 additions & 1 deletion jarvis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ configure () {
'start_listening'
'stop_listening'
'start_speaking'
'stop_speaking')
'stop_speaking'
'listening_timeout')
case "$1" in
bing_speech_api_key) eval "$1=\"$(dialog_input "Bing Speech API Key\nHow to get one: http://domotiquefacile.fr/jarvis/content/bing" "${!1}" true)\"";;
check_updates) options=('Always' 'Daily' 'Weekly' 'Never')
Expand Down Expand Up @@ -179,6 +180,7 @@ configure () {
stop_listening) editor hooks/$1;;
start_speaking) editor hooks/$1;;
stop_speaking) editor hooks/$1;;
listening_timeout) editor hooks/$1;;
language) options=("de_DE (Deutsch)"
"en_GB (English)"
"es_ES (Español)"
Expand Down Expand Up @@ -747,6 +749,7 @@ while true; do
if [ $retcode -eq 124 ]; then # timeout
sleep 1 # BUG here despite timeout mic still busy can't rec again...
$verbose && jv_debug "DEBUG: timeout, end of conversation" || jv_debug '(timeout)'
jv_hook "listening_timeout"
finish=true
else
jv_play sounds/error.wav
Expand Down
4 changes: 2 additions & 2 deletions stt_engines/snowboy/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ stt_sb_load # load models at startup
_snowboy_STT () {
[ -n "$1" ] && local timeout="utils/timeout.sh $1" || local timeout=""

local models=$snowboy_models
local models=("${snowboy_models[@]}")
local smodels="$snowboy_smodels"

# Limit model to trigger one
if [ -n "$2" ]; then
models=$snowboy_trigger_models
models=("${snowboy_trigger_models[@]}")
smodels="$snowboy_trigger_smodels"
fi

Expand Down
30 changes: 15 additions & 15 deletions utils/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,24 @@ jv_main_menu () {
"Hooks")
while true; do
options=("Program startup"
"Program exit"
"Entering command mode"
"Exiting command mode"
"Start listening"
"Stop listening"
"Listening timeout"
"Entering command mode"
"Start speaking"
"Stop speaking")
"Stop speaking"
"Exiting command mode"
"Program exit")
case "`dialog_menu 'Configuration > Hooks' options[@]`" in
Program*startup*) configure "program_startup";;
Program*exit*) configure "program_exit";;
Entering*) configure "entering_cmd";;
Exiting*) configure "exiting_cmd";;
Start*listening*) configure "start_listening";;
Stop*listening*) configure "stop_listening";;
Start*speaking*) configure "start_speaking";;
Stop*speaking*) configure "stop_speaking";;
Program*startup*) configure "program_startup";;
Program*exit*) configure "program_exit";;
Entering*) configure "entering_cmd";;
Exiting*) configure "exiting_cmd";;
Listening*timeout) configure "listening_timeout";;
Start*listening*) configure "start_listening";;
Stop*listening*) configure "stop_listening";;
Start*speaking*) configure "start_speaking";;
Stop*speaking*) configure "stop_speaking";;
*) break;;
esac
done;;
Expand All @@ -112,8 +114,7 @@ jv_main_menu () {
"Min noise duration to start ($min_noise_duration_to_start)"
"Min noise perc to start ($min_noise_perc_to_start)"
"Min silence duration to stop ($min_silence_duration_to_stop)"
"Min silence level to stop ($min_silence_level_to_stop)"
"Max noise duration to kill ($max_noise_duration_to_kill)")
"Min silence level to stop ($min_silence_level_to_stop)")
case "`dialog_menu 'Configuration > Audio' options[@]`" in
Speaker*) configure "play_hw";;
Mic*) configure "rec_hw";;
Expand Down Expand Up @@ -147,7 +148,6 @@ EOM
*perc*start*) configure "min_noise_perc_to_start";;
*duration*stop*) configure "min_silence_duration_to_stop";;
*level*stop*) configure "min_silence_level_to_stop";;
*duration*kill*) configure "max_noise_duration_to_kill";;
*) break;;
esac
done;;
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.03.26
17.04.01

0 comments on commit b2ac6a4

Please sign in to comment.