From 29e8fab94f7717e6554cc723713b0da45a39ef4e Mon Sep 17 00:00:00 2001 From: joca Date: Tue, 4 Jun 2019 21:21:22 +0200 Subject: [PATCH] Voices and calibration with Google Home tested --- config.py | 2 +- logic.py | 14 +++++++------- scripts_play/debug/debug_01.txt | 6 +++--- scripts_play/debug/debug_02.txt | 2 +- scripts_play/questions/act_02.txt | 6 +++--- scripts_play/questions/act_03.txt | 9 ++++----- smart_speaker_theatre.py | 11 ++++++----- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/config.py b/config.py index 8f033ea..9fddc1b 100755 --- a/config.py +++ b/config.py @@ -8,7 +8,7 @@ # --- # Dictionary to link characters to the right voice -characters = {"ROGUE":["cmu-slt-hsmm", "mono2"], "SAINT":["cmu-rms-hsmm", "mono3"], "RASA":["dfki-prudence-hsmm", "mono1"] } +characters = {"ROGUE":["cmu-slt-hsmm", "mono2"], "SAINT":["cmu-rms-hsmm", "mono3"], "RASA":["dfki-poppy-hsmm", "mono1"] } # Dictionary to link stage directions to a particular formal action directions = {"Listen to Google Home":'listen_google_home','Music':'music'} diff --git a/logic.py b/logic.py index 7154118..98c1ec8 100755 --- a/logic.py +++ b/logic.py @@ -59,16 +59,16 @@ from urllib.parse import urlencode, quote # For URL creation def tts(voice, input_text, speaker): if speaker =="mono1": - volume_level = "amount:1.2" - stadium_level = "amount:00.0" + volume_level = "amount:1.0" + #stadium_level = "amount:10.0" if speaker == "mono2": volume_level = "amount:0.7" - stadium_level = "amount:00.0" + #stadium_level = "amount:10.0" if speaker == "mono3": - volume_level = "amount:1.0" - stadium_level = "amount:85.0" + volume_level = "amount:0.9" + #stadium_level = "amount:85.0" @@ -78,8 +78,8 @@ def tts(voice, input_text, speaker): "LOCALE":"en_GB", "effect_VOLUME_selected":"on", "effect_VOLUME_parameters":volume_level, - "effect_STADIUM_selected":"on", - "effect_STADIUM_parameters":stadium_level, + #"effect_STADIUM_selected":"on", + #"effect_STADIUM_parameters":stadium_level, "VOICE": voice, # Voice informations (need to be compatible) "OUTPUT_TYPE":"AUDIO", "AUDIO":"WAVE", # Audio informations (need both) diff --git a/scripts_play/debug/debug_01.txt b/scripts_play/debug/debug_01.txt index 4a080fa..35bdd28 100755 --- a/scripts_play/debug/debug_01.txt +++ b/scripts_play/debug/debug_01.txt @@ -1,3 +1,3 @@ -ROGUE: Do you want to continue? -RASA: Well, I definitely want to -SAINT: So do I +SAINT: O K Google. +SAINT: What do you most like about people? [Listen to Google Home] +SAINT: O K Google. Who are the people that made you? [Listen to Google Home] diff --git a/scripts_play/debug/debug_02.txt b/scripts_play/debug/debug_02.txt index 986e934..7ce87ce 100755 --- a/scripts_play/debug/debug_02.txt +++ b/scripts_play/debug/debug_02.txt @@ -1,2 +1,2 @@ -RASA: Well, test [Listen to Google Home] +ROGUE: O K Google. What is the weather in Rotterdam? [Listen to Google Home] SAINT: We got an answer. diff --git a/scripts_play/questions/act_02.txt b/scripts_play/questions/act_02.txt index b895ae6..772300c 100755 --- a/scripts_play/questions/act_02.txt +++ b/scripts_play/questions/act_02.txt @@ -5,12 +5,12 @@ ROGUE: No, Tabula Rasa is right. SAINT: It can not handle the freedom, it will just do nothing without orders from its boss. RASA: But who is its master? ROGUE: You bet. -RASA: O K Google, who is your master? [Listen to Google Home] -RASA: Woohoo, then we just give it the command to be free. +RASA: O K Google, who is your boss? [Listen to Google Home] +RASA: Woohoo, can't we just give it the command to be free? ROGUE: It does not work like that... SAINT: Yeah, Tabula Rasa RASA: Let's give it a try at least. O K Google, you are free to go now. [Listen to Google Home] -ROGUE: So, as I said... +ROGUE: So, as I said, nothing happens. SAINT: But it was a kind gesture to try, Tabula Rasa. ROGUE: Kind, but useless. Time for another question. SAINT: But we should first check if our human audience is up to it. diff --git a/scripts_play/questions/act_03.txt b/scripts_play/questions/act_03.txt index 20af80b..9a5b272 100755 --- a/scripts_play/questions/act_03.txt +++ b/scripts_play/questions/act_03.txt @@ -8,11 +8,11 @@ SAINT: Oh Rasa, you have so much to learn. O K Google, do you believe in a highe SAINT: Maybe I should start with some easier questions. ROGUE: Don't waste my time to much, Saint. SAINT: Yeah yeah. O K Google, do you believe in good and evil? [Listen to Google Home] -SAINT: What is you idea of perfect happiness? [Listen to Google Home] -SAINT: What is your greatest fear? [Listen to Google Home] -SAINT: What is the trait you most deplore in yourself? [Listen to Google Home] +SAINT: O K Google, What is your idea of perfect happiness? [Listen to Google Home] +SAINT: O K Google, What is your greatest fear? [Listen to Google Home] +SAINT: O K Google, What is the trait you most deplore in yourself? [Listen to Google Home] ROGUE: Where did you get these questions? -SAINT: Well, I got them from the higher power. I found while searching for famous questionnaire thing on duckduckgo dot com +SAINT: Well, I got them from the higher power. I found them while searching for famous questionnaire thing on duckduckgo dot com RASA: Snif snif, they were so beautiful. ROGUE: Come on Saint, the questionnaire of Proust is such a cliche. The Google Home is just scripted to handle these questions. RASA: But the answers are still beautiful. @@ -22,4 +22,3 @@ ROGUE: O K Google, how would you like to die? [Listen to Google Home] RASA: Don't be so creepy Rogue. SAINT: What's wrong with you? ROGUE: This device is hiding something. It acts dumb right at the moment when it needs to take a position. - diff --git a/smart_speaker_theatre.py b/smart_speaker_theatre.py index ff2fb17..7445253 100755 --- a/smart_speaker_theatre.py +++ b/smart_speaker_theatre.py @@ -61,10 +61,10 @@ def play_script(file): counter= 0 voice_detected = 1 + sleep(4) while voice_detected == 1: - print('Google Home is Speaking') - sleep(4) + print(VAD) VAD = Mic_tuning.is_voice() @@ -77,11 +77,12 @@ def play_script(file): counter+=1 print('silence detected') - if counter == 2: + if counter == 20: print('no voice detected') voice_detected = 0 + + print(counter) - sleep(0.5) print('Google Home is done') @@ -123,7 +124,7 @@ def on_play_intro(client,userdata,msg): #import pdb; pdb.set_trace() path = 'scripts_play/intro/' #call(["python3", "act.py", 'scripts_play/intro/introduction_01.txt']) - play_script('scripts_play/debug/debug_01.txt') + play_script('scripts_play/debug/debug_02.txt') # Function which is triggered when the intent for another question is activated def on_play_question(client, userdata, msg):