def stop_speaking(): # TODO: Less hacky approach to this once Audio Manager is implemented # Skills should only be able to stop speech they've initiated from mycroft.messagebus.send import send create_signal('stoppingTTS') send('mycroft.audio.speech.stop') # Block until stopped while check_for_signal("isSpeaking", -1): time.sleep(0.25) # This consumes the signal check_for_signal('stoppingTTS')
def is_speaking(): """Determine if Text to Speech is occurring Returns: bool: True while still speaking """ return check_for_signal("isSpeaking", -1)
def stop_speaking(): # TODO: Less hacky approach to this once Audio Manager is implemented # Skills should only be able to stop speech they've initiated config = mycroft.configuration.ConfigurationManager.instance() create_signal('stoppingTTS') # Perform in while loop in case the utterance contained periods and was # split into multiple chunks by handle_speak() while check_for_signal("isSpeaking", -1): _kill([config.get('tts').get('module')]) _kill(["aplay"]) time.sleep(0.25) # This consumes the signal check_for_signal('stoppingTTS')
def stop_speaking(ws=None): from mycroft.messagebus.client.ws import WebsocketClient from mycroft.messagebus.message import Message if ws is None: ws = WebsocketClient() # TODO: Less hacky approach to this once Audio Manager is implemented # Skills should only be able to stop speech they've initiated create_signal('stoppingTTS') ws.emit(Message('mycroft.audio.speech.stop')) # Block until stopped while check_for_signal("isSpeaking", -1): time.sleep(0.25) # This consumes the signal check_for_signal('stoppingTTS')
def stop_speaking(): """Stop mycroft speech. TODO: Skills should only be able to stop speech they've initiated """ if is_speaking(): from mycroft.messagebus.send import send send('mycroft.audio.speech.stop') # Block until stopped while check_for_signal("isSpeaking", -1): time.sleep(0.25)