summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-10-13 14:19:51 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-10-13 14:19:51 +0200
commitd60fc91dbf690dca2dc626046d63d5db4c308a7c (patch)
treef04c686ebb6804b1b17cba71736923e1e72ed223
parentbf134ab6a98e2b34dac7cb7d6e9d21e4afde1dba (diff)
downloadjasper-client-d60fc91dbf690dca2dc626046d63d5db4c308a7c.tar.gz
jasper-client-d60fc91dbf690dca2dc626046d63d5db4c308a7c.zip
Fix keyword detection regression in Mic.passiveListen()
Prior to commit 6bb87e20423e41f1bb79e6af285fe4d49cf1359a (Handle all Google Speech options, Pull Request #148), passive listen checked if the transcribed phrase contained the keyword. Since then, it only detects if the transcribed phrase was *exactly* the keyword. When using Pocketsphinx, it often happens that additional words are transcribed (like "JASPER OF"), so that saying the keyword sometimes did not result in an active listen call. With this commmit, this regression will be fixed and the old behaviour restored.
-rw-r--r--client/mic.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/mic.py b/client/mic.py
index ae5642e..2a6fe4a 100644
--- a/client/mic.py
+++ b/client/mic.py
@@ -175,7 +175,7 @@ class Mic:
transcribed = self.passive_stt_engine.transcribe(
f, mode=TranscriptionMode.KEYWORD)
- if PERSONA in transcribed:
+ if any(PERSONA in phrase for phrase in transcribed):
return (THRESHOLD, PERSONA)
return (False, transcribed)