From d60fc91dbf690dca2dc626046d63d5db4c308a7c Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 13 Oct 2014 14:19:51 +0200 Subject: 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. --- client/mic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') 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) -- cgit v1.3.1