def play_wake_up_answer_thread(self): """ Play a sound or make Kalliope say something to notify the user that she has been awaken and now waiting for order """ logger.debug("Entering state: %s" % self.state) # if random wake answer sentence are present, we play this if self.settings.random_wake_up_answers is not None: Say(message=self.settings.random_wake_up_answers) else: random_sound_to_play = self._get_random_sound(self.settings.random_wake_up_sounds) Mplayer.play(random_sound_to_play) self.next_state()
def callback(self): """ we have detected the hotword, we can now pause the Trigger for a while The user can speak out loud his order during this time. """ # pause the trigger process self.trigger_instance.pause() # start listening for an order self.order_listener.start() # if random wake answer sentence are present, we play this if self.settings.random_wake_up_answers is not None: Say(message=self.settings.random_wake_up_answers) else: random_sound_to_play = self._get_random_sound( self.settings.random_wake_up_sounds) Mplayer.play(random_sound_to_play)
def play_ready_sound_process(self): """ Play a sound when Kalliope is ready to be awaken at the first start """ logger.debug("Entering state: %s" % self.state) if (not self.on_ready_notification_played_once and self.settings.play_on_ready_notification == "once") or \ self.settings.play_on_ready_notification == "always": # we remember that we played the notification one time self.on_ready_notification_played_once = True # here we tell the user that we are listening if self.settings.on_ready_answers is not None: Say(message=self.settings.on_ready_answers) elif self.settings.on_ready_sounds is not None: random_sound_to_play = self._get_random_sound(self.settings.on_ready_sounds) Mplayer.play(random_sound_to_play) self.next_state()
def play_audio(self): """ Play the audio file """ Mplayer.play(self.file_path)