From deaa246bcb72a5bc56857e374e4f4f6f89dafb3a Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sat, 20 Oct 2012 20:53:52 +0200 Subject: [PATCH] Only pass speech events to google voice. --- saera.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/saera.py b/saera.py index c3cab32..da9712c 100644 --- a/saera.py +++ b/saera.py @@ -533,7 +533,9 @@ def run_saera(self, widget=None, event=None, data=None): result = False func = False - if(settings['use_google_voice'] == 'unrecognized' and result.startswith("I don't understand ")) or settings['use_google_voice'] == 'always': + if event == "speech-event" \ + and ((settings['use_google_voice'] == 'unrecognized' and result.startswith("I don't understand ")) \ + or settings['use_google_voice'] == 'always'): print "Sending to Google..." cmd = r'wget -q -U "Mozilla/5.0" --post-file /tmp/saera/output.flac -O- '\ '--header="Content-Type: audio/x-flac; rate='+str(SAMPLE_RATE)+r'" "'\