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.

Windows® Speech SDK on HoloLens®

I've created a non-Unity® based HoloLens® application that relies on the standard Windows® 10 Speech SDK. While text-to-speech is working as expected, speech recognition does not work at all and I can't find any precise instructions on how to implement this outside a Unity project (i.e. the application is coded using C# and SharpDX® directly).
Surprisingly, speech recognition works fine with the HoloLens® Emulator.

Here is the project: https://www.microsoft.com/en-us/store/p/spacetracker-holographic/9nblggh51jwj

Finally, a short code excerpt of how speech recognition is currently implemented:

SpeechGrammarFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(string.Format(Program.STRING("AppSpeechGrammarFileName"), Language.LanguageTag)));

SpeechRecognizer = new SpeechRecognizer(Language);

SpeechRecognizer.Timeouts.InitialSilenceTimeout = TimeSpan.FromSeconds(Constants.InitialSilenceTimeout);
SpeechRecognizer.Timeouts.EndSilenceTimeout = TimeSpan.FromMilliseconds(Constants.EndSilenceTimeout);

SpeechRecognizer.ContinuousRecognitionSession.ResultGenerated += OnInputAvailable;

SpeechRecognitionGrammarFileConstraint SpeechGrammarFileConstraint = new SpeechRecognitionGrammarFileConstraint(SpeechGrammarFile);
SpeechRecognitionListConstraint SpeechListConstraint = new SpeechRecognitionListConstraint(new List());

SpeechRecognizer.Constraints.Add(SpeechGrammarFileConstraint);
SpeechRecognizer.Constraints.Add(SpeechListConstraint);

if ((await SpeechRecognizer.CompileConstraintsAsync()).Status == SpeechRecognitionResultStatus.Success)
{
await SpeechRecognizer.ContinuousRecognitionSession.StartAsync(SpeechContinuousRecognitionMode.Default);
Initialized = true;
return string.Empty;
}

Any help would very much be appreciated.

Answers

  • edited September 2016

    As an addendum, I should mention that the 'Microphone' capability is enabled in the application manifest and also that the above code excerpt initializes successfully on the HoloLens®.

  • Hello I am also having a similar issue. I created a UWP App, which works fine on the PC. When I moved it over to the HoloLens it worked shortly and then completely stopped. I have checked the confidence and it was rejected and the status of the result from RecognizeAsync and it states NetworkFailure. Yes it is enabled in the manifest. Again, no issue on PC.

  • JamesJames
    edited August 2017

    @AdrainWenz: Can you also check if your app is Rejecting and what the status is? Wondering if we have the same issue.

    if (result.Confidence == SpeechRecognitionConfidence.Rejected)
    {
    //get status however you like
    stringStatus = result.Status.ToString();
    }

    Different Values and potential causes.
    https://docs.microsoft.com/en-us/uwp/api/windows.media.speechrecognition.speechrecognitionresultstatus

  • @James I 'resolved' the problem by drastically simplifying the grammar. To me it looks like if the HoloLens® simply does not have the computing power to process resp. recognize much more than single words. Phrases (more complex grammar) worked fine on the HoloLens® Emulator but not on the actual device.
    So, we have to wait for much more powerful devices.

Sign In or Register to comment.