Skip to content

[BUG] Put an empty/whitespace string in SpeechRecognitionKeyword break the whole speech system #612

Description

@anonymous2585

Describe the bug

If a user or a script set the SpeechRecognitionKeyword on a StatefulInteractable to an empty/whitespace string (and AllowSelectByVoice is still true), the whole speech system stops recognizint keywords, without any warning or error.

If you have a script (in my case a LocalizedStringEvent for Unity Localization package) that briefly set an empty string and then set the correct string, the bug still remains and speech won't work at all.

To reproduce

Steps to reproduce the behavior:

  1. Open the CanvasExemple scene
  2. Choose one button and set the SpeechRecognitionKeyword to an empty field
  3. Build & Run on Hololens
  4. Look at another button, say "select" and see nothing happen

Expected behavior

If one button SpeechRecognitionKeyword is set to an empty string, other buttons still work.

Your setup

  • Unity Version: 2021.3.21f1
  • MRTK Version or Commit: current main branch 3707957

Target platform

  • HoloLens 2

Additional context

The issue is that the SpeechInteractor allows to register interactable with an empty string put in the keywordDictionary and then the Unity KeywordRecognizer doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: InputThe Project input package is impacted by this issue.Type: BugA problem with an existing feature that can be fixed with the next patched release.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions