From cda97ee83ef3dcd8fc34d66593805da81dca747e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20M=C3=A9ly?= Date: Sat, 18 Mar 2017 17:02:15 +0100 Subject: [PATCH] bug fix --- utils/audio.sh | 19 ---- utils/menu.sh | 273 ------------------------------------------------- 2 files changed, 292 deletions(-) diff --git a/utils/audio.sh b/utils/audio.sh index 16f50c7..31e515b 100644 --- a/utils/audio.sh +++ b/utils/audio.sh @@ -12,25 +12,6 @@ jv_play () { fi } -<<<<<<< HEAD:utils/audio.sh -======= -RECORD () { # RECORD () {} record microhphone to audio file $1 when sound is detected until silence - $verbose && local quiet='' || local quiet='-d' - [ -n "$2" ] && local timeout="utils/timeout.sh $2" || local timeout="" - [ $platform = "linux" ] && export AUDIODRIVER=alsa - local cmd="$timeout rec -V1 -q -r 16000 -c 1 -b 16 -e signed-integer --endian little $1 gain $gain silence 1 $min_noise_duration_to_start $min_noise_perc_to_start 1 $min_silence_duration_to_stop $min_silence_level_to_stop trim 0 5" - $verbose && jv_debug "$cmd" - eval $cmd # need eval because of timeout, maybe better to change this - local retcode=$? - [ $retcode -eq 124 ] && return 124 # timeout - if [ "$retcode" -ne 0 ]; then - jv_error "ERROR: rec command failed" - jv_warning "HELP: Verify your mic in Settings > Audio > Mic" - jv_exit 1 - fi -} - ->>>>>>> origin/pr/478:jarvis-functions.sh jv_record_duration () { local audiofile=$1 local duration=$2 diff --git a/utils/menu.sh b/utils/menu.sh index f6e30ac..60554b1 100644 --- a/utils/menu.sh +++ b/utils/menu.sh @@ -442,276 +442,3 @@ EOM esac done } -<<<<<<< HEAD -======= - -while [ "$no_menu" = false ]; do - options=('Start Jarvis' - 'Settings' - 'Commands (what JARVIS can understand and execute)' - 'Events (what JARVIS monitors and notifies you about)' - 'Plugins (commands from community)' - 'Search for updates' - 'Help / Report a problem' - 'About') - case "`dialog_menu \" Jarvis - v$jv_version\n$headline\" options[@]`" in - Start*) - while true; do - options=('Start normally' 'Troubleshooting mode' 'Keyboard mode' 'Start as a service') - case "`dialog_menu 'Start Jarvis' options[@]`" in - "Start normally") - break 2;; - "Troubleshooting mode") - verbose=true - break 2;; - "Keyboard mode") - keyboard=true - quiet=true - break 2;; - "Start as a service") - jv_start_in_background - exit;; - *) break;; - esac - done;; - Settings) - while true; do - options=('Step-by-step wizard' - 'General' - 'Phrases' - 'Hooks' - 'Audio' - 'Voice recognition' - 'Speech synthesis') - case "`dialog_menu 'Configuration' options[@]`" in - "General") - while true; do - options=("Username ($username)" - "Trigger mode ($trigger_mode)" - "Magic word ($trigger)" - "Show possible commands ($show_commands)" - "Multi-command separator ($separator)" - "Conversation mode ($conversation_mode)" - "Language ($language)" - "Check Updates on Startup ($check_updates)" - "Usage Statistics ($send_usage_stats)") - case "`dialog_menu 'Configuration > General' options[@]`" in - Username*) configure "username";; - Trigger*) configure "trigger_mode";; - Magic*word*) configure "trigger";; - Show*commands*) configure "show_commands";; - Multi-command*separator*) configure "separator";; - Conversation*) configure "conversation_mode";; - Language*) configure "language";; - Check*Updates*) configure "check_updates";; - Usage*Statistics*) configure "send_usage_stats";; - *) break;; - esac - done;; - "Phrases") - while true; do - options=("Startup greetings ($phrase_welcome)" "Trigger reply ($phrase_triggered)" "Unknown order ($phrase_misunderstood)" "Command failed ($phrase_failed)") - case "`dialog_menu 'Configuration > Phrases' options[@]`" in - Startup*greetings*) configure "phrase_welcome";; - Trigger*reply*) configure "phrase_triggered";; - Unknown*order*) configure "phrase_misunderstood";; - Command*failed*) configure "phrase_failed";; - *) break;; - esac - done;; - "Hooks") - while true; do - options=("Program startup" - "Program exit" - "Entering command mode" - "Exiting command mode" - "Start listening" - "Stop listening" - "Start speaking" - "Stop speaking") - 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";; - *) break;; - esac - done;; - "Audio") - while true; do - options=("Speaker ($play_hw)" - "Mic ($rec_hw)" - "Auto-adjust levels" - "Volume" - "Sensitivity" - "Gain ($gain)" - "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)") - case "`dialog_menu 'Configuration > Audio' options[@]`" in - Speaker*) configure "play_hw";; - Mic*) configure "rec_hw";; - Auto*) jv_auto_levels;; - Volume) if [ "$platform" == "osx" ]; then - osascript < Voice recognition' options[@]`" in - Recognition*magic*word*) configure "trigger_stt";; - Recognition*command*) configure "command_stt";; - Snowboy*) - while true; do - options=("Show trained hotwords/commands" - "Token ($snowboy_token)" - "Train a hotword/command" - "Sensitivity ($snowboy_sensitivity)") - case "`dialog_menu 'Settings > Voice recognition > Snowboy' options[@]`" in - Show*) IFS=','; dialog_msg "Models stored in stt_engines/snowboy/resources/:\n${snowboy_models[*]}";; - Sensitivity*) configure "snowboy_sensitivity";; - Token*) configure "snowboy_token";; - Train*) stt_sb_train "$(dialog_input "Hotword / Quick Command to (re-)train" "$trigger")" true;; - *) break;; - esac - done;; - Bing*) - while true; do - options=("Bing key ($bing_speech_api_key)") - case "`dialog_menu 'Settings > Voice recognition > Bing' options[@]`" in - Bing*key*) configure "bing_speech_api_key";; - *) break;; - esac - done;; - Wit*) - while true; do - options=("Wit key ($wit_server_access_token)") - case "`dialog_menu 'Settings > Voice recognition > Wit' options[@]`" in - Wit*) configure "wit_server_access_token";; - *) break;; - esac - done;; - PocketSphinx*) - while true; do - options=("PocketSphinx dictionary ($dictionary)" - "PocketSphinx language model ($language_model)" - "PocketSphinx logs ($pocketsphinxlog)") - case "`dialog_menu 'Settings > Voice recognition > PocketSphinx' options[@]`" in - PocketSphinx*dictionary*) configure "dictionary";; - PocketSphinx*model*) configure "language_model";; - PocketSphinx*logs*) configure "pocketsphinxlog";; - *) break;; - esac - done;; - *) break;; - esac - done;; - "Speech synthesis") - while true; do - options=("Speech engine ($tts_engine)" "OSX voice ($osx_say_voice)" "Cache folder ($tmp_folder)") #"Voxygen voice ($voxygen_voice)" - case "`dialog_menu 'Configuration > Speech synthesis' options[@]`" in - Speech*engine*) configure "tts_engine";; - #Voxygen*voice*) configure "voxygen_voice";; - OSX*voice*) configure "osx_say_voice";; - Cache*folder*) configure "tmp_folder";; - *) break;; - esac - done;; - "Step-by-step wizard") - wizard;; - *) break;; - esac - done - configure "save";; - Commands*) - editor jarvis-commands - #update_commands - ;; - Events*) - dialog_msg <> jarvis-events -Press [Ok] to start editing Event Rules -EOM - editor jarvis-events && - crontab jarvis-events -i;; - Plugins*) - menu_store - ;; - Help*) - dialog_msg <>>>>>> origin/pr/478