Use OSX speech recognition without microphone widget

Is there a way to use voice commands on OSX without an on-screen microphone widget, whether app based or system based?

I am currently trying to create a Python speech recognition application on OSX that I can use while playing Elite to control game features and my music player. I found this fantastic example I will build and found to prevent it from interfering with the sound of the game.

The problem I am facing is that the screen widget, when using speech recognition, interferes with playing a full screen game. I understand the privacy and security reasons for the widget, but is there a way to "opt out" of this?

The answer is no need to use Python, but bonus internet points if so!

+3


source to share


1 answer


tl; dr's answer is "maybe yes, try making the app full screen".

The Speech Recognition documents [1] imply that the on-screen microphone is not optional:

When speech recognition is activated, an on-screen microphone and (optional) the Speech Commands window appears.

However, the NSSpeechRecognizer

docs explicitly mention [2] that fullscreen apps are on-screen microphone compatible (emphasis mine):

Setting [blocksOtherRecognizers] to YES effectively takes over the computer at the expense of other applications using speech recognition, so you should only use it in circumstances that justify it, such as when listening to a response important to the overall operation of the system, or when the application is running in full screen mode (such as games and presentation software) .



This, I believe, implies that if your application (the one that uses speech recognition) is full screen, then the microphone widget will not appear. The question is whether more than one full-screen application can be running at the same time - you can try to explore the corresponding APIs [3].

Otherwise, you could look into third party app recognition libraries for Python (the last time I checked there are many good options out there) or try plugging in a second display and see if you can have an app with microphone widgets and a game running on different screens.

Mac Developer Library Links

+1


source







All Articles