From 2ffb25806937fd423475fe85129e82f979338dab Mon Sep 17 00:00:00 2001 From: Joseph Pan Date: Sun, 27 Aug 2017 19:59:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=97=B2=E8=81=8A=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/conversation.py | 3 ++- client/mic.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/conversation.py b/client/conversation.py index 064b2b3..f0ad3f6 100644 --- a/client/conversation.py +++ b/client/conversation.py @@ -70,7 +70,8 @@ def handleForever(self): continue self._logger.info("Keyword '%s' has been said!", self.persona) else: - self.mic.skip_passive = False + if not self.mic.chatting_mode: + self.mic.skip_passive = False self._logger.debug("Started to listen actively with threshold: %r", threshold) diff --git a/client/mic.py b/client/mic.py index 5450b93..207c622 100644 --- a/client/mic.py +++ b/client/mic.py @@ -52,6 +52,7 @@ def __init__(self, profile, speaker, passive_stt_engine, self._logger.info("Initialization of PyAudio completed.") self.stop_passive = False self.skip_passive = False + self.chatting_mode = False def __del__(self): self._audio.terminate()