Catch and print what User Said


What would be the best way to catch what user said? I was looking into the message bus but that seems to only catch what Mycroft says?

I’m still a beginner with Mycroft skills development, and I saw an older skill which transcribed dictation to text but could not really figure out how it works.

Thanks in advance for any leads.

1 Like


The recognizer_loop:utterance message can be used to get the users utterances.

An example using the mycroft_bus_client module:

from mycroft_bus_client import MessageBusClient                                 
print('Setting up client to connect to a local mycroft instance')               
client = MessageBusClient()                                                     
def print_user_utterance(message):                                              
    print('The user said "{}"'.format('utterances')[0]))       
print('Registering handler for recorded speech message...')                     
client.on('recognizer_loop:utterance', print_user_utterance)                    

Ah, amazing! So it is possible via the message bus client; thanks so much!

1 Like