Skip to content

Commit 8f0c76f

Browse files
Made sure Windows Speech Input's event data was raised by gaze, as Focused Object is determined by the event's input source.
Updated SpeechInputHandler to only check if speech commands profile was null instead of if the speech commands were enabled.
1 parent 9fc2955 commit 8f0c76f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Assets/MixedRealityToolkit-SDK/Inspectors/Input/Handlers/SpeechInputHandlerInspector.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public override void OnInspectorGUI()
4949
return;
5050
}
5151

52+
if (MixedRealityManager.Instance.ActiveProfile.InputSystemProfile.SpeechCommandsProfile == null)
53+
{
54+
EditorGUILayout.HelpBox("No Speech Commands Profile Found, be sure to specify a profile in the Input System's configuration profile.", MessageType.Error);
55+
return;
56+
}
57+
5258
if (registeredKeywords == null || registeredKeywords.Length == 0)
5359
{
5460
registeredKeywords = RegisteredKeywords().Distinct().ToArray();
@@ -151,7 +157,7 @@ private void ShowList(SerializedProperty list)
151157
private static IEnumerable<string> RegisteredKeywords()
152158
{
153159
if (!MixedRealityManager.Instance.ActiveProfile.IsInputSystemEnabled ||
154-
!MixedRealityManager.Instance.ActiveProfile.InputSystemProfile.IsSpeechCommandsEnabled ||
160+
MixedRealityManager.Instance.ActiveProfile.InputSystemProfile.SpeechCommandsProfile == null ||
155161
MixedRealityManager.Instance.ActiveProfile.InputSystemProfile.SpeechCommandsProfile.SpeechCommands.Length == 0)
156162
{
157163
yield break;

Assets/MixedRealityToolkit/_Core/Devices/VoiceInput/WindowsSpeechInputDeviceManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private void OnPhraseRecognized(ConfidenceLevel confidence, TimeSpan phraseDurat
121121
{
122122
if (Commands[i].Keyword == text)
123123
{
124-
MixedRealityManager.InputSystem.RaiseSpeechCommandRecognized(InputSource, Commands[i].Action, (RecognitionConfidenceLevel)confidence, phraseDuration, phraseStartTime, text);
124+
MixedRealityManager.InputSystem.RaiseSpeechCommandRecognized(MixedRealityManager.InputSystem.GazeProvider.GazeInputSource, Commands[i].Action, (RecognitionConfidenceLevel)confidence, phraseDuration, phraseStartTime, text);
125125
break;
126126
}
127127
}

0 commit comments

Comments
 (0)