From 7dd3bb99159523c23ae23cda15494eb56c31994b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 26 Mar 2018 00:32:03 +0200 Subject: [PATCH] Always call stop_playback even when there is no user request --- platypush/backend/assistant/google/pushtotalk.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platypush/backend/assistant/google/pushtotalk.py b/platypush/backend/assistant/google/pushtotalk.py index 750d4fd9..04536614 100644 --- a/platypush/backend/assistant/google/pushtotalk.py +++ b/platypush/backend/assistant/google/pushtotalk.py @@ -299,10 +299,13 @@ class SampleAssistant(object): logging.info('Finished playing assistant response.') - if user_request: + try: self.conversation_stream.stop_playback() - if self.on_speech_recognized: - self.on_speech_recognized(user_request) + except: + pass + + if user_request and self.on_speech_recognized: + self.on_speech_recognized(user_request) return (user_request, continue_conversation)