Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Voice recognition does not work

Hi, I am adding voice recognition to my App. I enabled microphone in Unity. But when I ran the App, the voice recognition did not work. I saw some error message as below:

Capability 'internetClient' is required, please enable it in Package.appxmanifest because you're using WWW functionality.

How can I fix it?

Thank you very much.

Fireman

Answers

  • Options

    @Fireman, it sounds like you are using the DictationRecognizer, which requires an internet connection. To enable this recognizer, you will need to check the InternetClient capability in Unity (like you did for Microphone).

    If you are looking to do simple phrase recognition, you will want to use the KeywordRecognizer and then the InternetClient capability will not be required.

    If you have not looked at the Holograms 212: Voice academy course, I highly recommend it. It demonstrates effective use of the DictationRecognizer and KeywordRecognizer as well as discusses some key dos and don'ts.

    The documentation also provides some great information regarding voice input.

    Thanks!
    David

  • Options

    @Fireman I have an app that is working with speech recognition that does not have "internetClient" check in the Project | Player | Capabilities list, so I don't think that error message is necessarily the problem with your speech recognition.

    Did you add a Speech Manager script to one of the game objects in your scene similar to the Holograms 101 tutorial?

    Besides the keywordrecognizer code in that script do you also have matching handlers for the messages associated to each keyword? Those handlers are typically in a script associated to the target game object.

    How closely aligned is your code to the Holograms 101 (or some other) tutorial?

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • Options

    Here is my code, very similar to 101E

    void Start()
    {
        // Grab the mesh renderer that's on the same object as this script.
        meshRenderer = this.gameObject.GetComponentInChildren<MeshRenderer>();
    
        keywords.Add("Hello", () =>
            {
                movePiece();
            });
    
        keywords.Add("Rock", () =>
            {
    
            });
    
        // Tell the KeywordRecognizer about our keywords.
        keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());
    
        // Register a callback for the KeywordRecognizer and start recognizing!
        keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
        keywordRecognizer.Start();
    
    }
    
    
    void movePiece(){
        xxxx
    }
    
    private void KeywordRecognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args)
    {
        System.Action keywordAction;
        if (keywords.TryGetValue (args.text, out keywordAction)) {
            keywordAction.Invoke ();
        }
    }
    
  • Options

    @Fireman,

    The KeywordRecognizer does not user or require the InternetClient capability. I believe that message is based on other code in your project.

    It may be that the code triggering the InternetClient message is causing your keyword code to be skipped.

    If you set a breakpoint in your KeywordRecognizer_OnPhraseRecognized and movePiece methods, are they hit?

    Thanks!
    David

  • Options

    The internet client debug message started recently, and my gut says that this is Unity Analytics. Totally a red herring.

    Is it possible that keywords is uninitialized?

    I've also found it helpful to set debugging to "managed and native" and turn off 'just my code'.

    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

Sign In or Register to comment.