Voice Intents not working

Unity 2022.2b8
ML2 B3E.220818.12-R.085 (SDK Version 29)
MLSDK 0.53.3
Windows 10

I am trying to implement Voice Intents into our program and it does not appear to be working. What I have tracked down is that even after requesting the VoiceInput permission and obtaining it, MLVoice.VoiceEnabled always returns false. If I do not check that beforehand and attempt to call MLVoice.SetupVoiceIntents, I get an error that contains a code indicating that the Voice Input is not available.

The code I have is cross platform so I have just put the ML2 code into the same paradigm as what I had and it works as following:

  1. application goes to register 'keywords' which take actions, calls start on a "SpeechCommandRecognizer" which is a non-Unity class (i.e., not a Monobehaviour)
  2. SpeechCommandRecognizer checks to see if it has the VoiceInput permission, if it does not it requests it and returns (if it has it, skip to 4)
  3. When SpeechCommandRecognizer gets permissions, call Start again
  4. SpeechCommandRecognizer checks to see if MLVoice.VoiceEnabled is true, if not error out (if i don't disable this line, this is as far as it will go)
    SpeechCommandRecognizer creates MLVoiceIntentsConfiguration scriptable object, and sets the lists on it to blank lists.
  5. SpeechCommandRecognizer creates all the CustomVoiceIntent objects and adds them to the VoiceCommandsToAdd list
  6. SpeechCommandRecognizer calls MLVoice.SetupVoiceIntents
  7. if successful, SpeechCommandRecognizer adds event to MLVoice.OnVoiceEvent (never gets to this point successfully)

Are there any known issues with this functionality? I'm not quite sure what I'm doing wrong here.

1 Like

@peter.nolen Sorry to hear that your having these issues. Have you enabled voice input on your device? You can do so by opening the settings application, then selecting Magic Leap inputs.

2 Likes

Ah. No I didn't realize it had to be enabled at the system level, so all I had done was enable the VOICE_INPUTS permission in the manifest. Appears to be working, thanks.

1 Like