@@ -50,6 +50,11 @@ def default_listen_mode(self):
5050 else :
5151 return "wakeword"
5252
53+ def is_dictating (self , sess ) -> bool :
54+ if sess .session_id in self .dictation_sessions :
55+ return self .dictation_sessions [sess .session_id ].get ("dictating" , False )
56+ return False
57+
5358 @adds_context ("DictationKeyword" , "dictation" )
5459 def start_dictation (self , message = None ):
5560 message = message or Message ("" )
@@ -82,15 +87,17 @@ def stop_dictation(self, message=None):
8287
8388 @intent_handler ("start_dictation.intent" )
8489 def handle_start_dictation_intent (self , message ):
85- if not self .dictating :
90+ sess = SessionManager .get (message )
91+ if not self .is_dictating (sess ):
8692 self .speak_dialog ("start" , wait = True )
8793 else :
8894 self .speak_dialog ("already_dictating" , wait = True )
8995 self .start_dictation (message ) # enable continuous listening, no wake word needed
9096
9197 @intent_handler ("stop_dictation.intent" )
9298 def handle_stop_dictation_intent (self , message ):
93- if self .dictating :
99+ sess = SessionManager .get (message )
100+ if not self .is_dictating (sess ):
94101 self .speak_dialog ("stop" )
95102 else :
96103 self .speak_dialog ("not_dictating" )
0 commit comments