Is there a way to programattically trigger a listen?

Mycroft’s not very good at doing the wakeword thing in noisy/chaotic environments, and I have a two year old :frowning: So, naturally I thought I might write a shell script or maybe even an Android app that lets me trigger the wakeword with a button tap or something.

Unfortunately, the long list of message types doesn’t appear to include anything about telling Mycroft to “start listening now”, so I’m asking here: is this even possible? Am I just misreading the docs? Is there a different/smarter/better way to tell Mycroft that now is the time to listen?

Alternatively, it’d be alright to be able to commands to Mycroft directly (without a wakeword event happening). So I could (for example) speak into my phone “what’s the weather” and have it send the text over an API to tell Mycroft to do the weather thing.

Is this an option in Mycroftland?

You can issue commands via the message bus.

I’m aware of this, which is why I linked to the message types in my question. My problem is that I don’t see how to tell Mycroft to start listening by way of the message bus. I can tell it to “stop”, to “speak”, or any other number of commands, but I didn’t see anything in there to trigger the wakeword process, to substitute for someone actually saying “Hey Mycroft” and the device correctly hearing that and start listening for a command.

You can issue a mycroft.mic.listen on the message bus

Send a message to be spoken

python -m mycroft.messagebus.send “mycroft.mic.listen”

1 Like

Ah! That’s excellent thank you. In my own reading of the doc, I guess I didn’t understand that to mean “wait for command”. I thought it was just to start arbitrary recording of sound. This is very helpful!

1 Like