What about a voice interface using NSSpeechRecognizer?

We all know that macOS 'Voice Control' allows us to create custom commands, but I'm not thinking about executing a command.

What I'm thinking about is allowing the user to interact with a macro using a custom instance of NSSpeechRecognizer. We would be able, for example, to create a macro that would say 'Who should i send the message to?'

Keyboard Maestro would allow user to create a list of possible commands (answers), something like: 'Mary', 'Robert', 'Jhon'. NSSpeechRecognizer has great accuracy with such a small command list!

Hammerspoon has hs.speech.listener implemented. I think something similar would open a wide range of possibilities with Keyboard Maestro.

What do you think?

You could always create a Shortcut that used the Dictate Text action to collect the user input, then use KM's "Execute Shortcut" action and put the returned text into a variable. Demo:

Image of Shortcut

Spoken text from Shortcut.kmmacros (3.8 KB)

Image of Macro

Yes, this is a great tip!

But there is a difference between dictation and voice command.

"NSSpeechRecognizer provides a “command and control” style of voice recognition system, where the command phrases must be defined prior to listening, in contrast to a dictation system where the recognized text is unconstrained."

This difference translates into speed and accuracy in the user experience. In practice, it is something quite different.

Also there is a speed gain in the fact that "Dictate text" action has to wait for a pause to return the user dictation imput.

We could also mention the need to process the "raw" text returned by the Shortcut app in a standardized way.