-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename speech-related subsystems and add a sample scene for dictation #11348
Conversation
Missing a |
UnityProjects/MRTKDevTemplate/Assets/Scripts/SpeechRecognitionHandler.cs
Outdated
Show resolved
Hide resolved
The naming is starting to confuse me. If "SpeechRecognition" is actually speech-to-text, or dictation/transcription (instead of event-based recognitions like see-it-say-it) can we call it Dictation or something? |
/// events fired by SpeechRecognitionSubsystem. | ||
/// </summary> | ||
[AddComponentMenu("MRTK/Examples/Speech Recognition Handler")] | ||
public class SpeechRecognitionHandler : MonoBehaviour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it internal just so folks don't end up taking a dep on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script is a sample script (i.e. in Assembly-CSharp) so not sure if internal
ing it would do much.
Click the button to stop transcribing doesn't work, it just keeps going! I can take a video if you want, but clicking the button to stop it doesn't seem to have any effect at all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully we can get the threading errors to go away. The only other thing I consider blocking is the fact that the button doesn't seem to stop transcription.
The perf spike is very unfortunate. Hopefully we can offload to a background thread.
@Zee2 I looked into the spike and tried to move the instantiate of the Unity |
Fortunately, the spike only appears the first time the Unity recognizer gets created. I will be calling the recognizer constructor once in the subsystem constructor / Start() so that hopefully the hit is only taken at app launch if the user enables the subsystem via the profile. |
Upon further investigation dummy initialization at start does not work. Will file a ticket to Unity regarding the time spike. |
Now fixed! |
{ | ||
return XRSubsystemHelpers.GetFirstRunningSubsystem<PhraseRecognitionSubsystem>() as PhraseRecognitionSubsystem; | ||
return XRSubsystemHelpers.GetFirstRunningSubsystem<KeywordRecognitionSubsystem>() as KeywordRecognitionSubsystem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is the as KeywordRecognitionSubsystem
part needed? I thought this helper returned the same type as the passed-in T
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also wonder if we want to move this to the new pattern @Zee2 is introducing for the hands aggregator in #11333: https://github.com/microsoft/MixedRealityToolkit-Unity/pull/11333/files#diff-6bb0070ef5fe1b4e52210a345ab2f2c2f693e0b9cff69e18e05456aef8969376R160
Basically, deprecating the old helper from HandsUtils
and putting it into XRSubsystemHelpers
directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
/// <summary> | ||
/// Event data associated with the result of dictation. | ||
/// </summary> | ||
public class DictationResultEventArgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these event args reused or one-time-use? if the latter, could they be rewritten as readonly structs to more clearly express the design intent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now rewritten as readonly structs!
…microsoft#11348) * Add a sample scene for SpeechRecognitionSubsystem * Feedback * Update WindowsSpeechRecognitionSubsystem.cs * Interface and subsystem rename part 1 * Interface and subsystem rename part 2 * Interface and subsystem rename part 3 * Rename configs * More renaming * Rename sample scene * Update DictationExample.unity * Feedback * Add private setters to expose properties in the inspector * Add sample scene hand menu * Better display of error message Co-authored-by: Finn Sinclair <finnnorth@gmail.com>
Overview