Using Mac OSX Dictation with Speech API

In OSX Mavericks, speech diction is now enabled and very useful. I'm trying to use the dictation features to create my own digital life assistant, but I cannot find how to use the recognition functions to get speech in the application, not a text field.

I looked at NSSpeechRecognizer, but it seems to be focused on programming voice commands with a predefined grammar, not dictation. It doesn't matter which programming language I use, but Python or Java would be nice ...

Thank you for your help!

+7
source share
1 answer

You can use SFSpeechRecognizer ( mirror ) ( macOS 10.15 + is required): this is done for speech recognition.

Perform speech recognition on live or pre-recorded audio, get transcription, alternative interpretations and confidence levels of results.

Taking into account that, as you noted in the question, NSSpeechRecognizer ( mirror ) really provides the style of a voice recognition system in the style of “command and control” (command phrases must be defined before listening, unlike a dictation system in which the recognized text is not limited )

From https://developer.apple.com/videos/play/wwdc2019/256/ ( mirror ):

enter image description here

Another way is to use Mac Dictation directly, but as far as I know, the only way is to redirect audio channels that are not very neat, for example, see http://www.showcasemarketing.com/ideablog/transcribe-mp3-audio. -to-text-mac-os / ( mirror ).

+1
source

All Articles