Skip to content
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

Dictation Focus #1690

Conversation

StephenHodgson
Copy link
Contributor

Overview

Added modal focus for the currently listening game object during dictation.

Changes

@StephenHodgson StephenHodgson changed the base branch from master to Dev_Working_Branch February 4, 2018 20:35
@keveleigh keveleigh changed the title Dictation Foucs Dictation Focus Feb 4, 2018
NeerajW
NeerajW previously approved these changes Feb 6, 2018
/// <param name="initialSilenceTimeout">The time length in seconds before dictation recognizer session ends due to lack of audio input in case there was no audio heard in the current session.</param>
/// <param name="autoSilenceTimeout">The time length in seconds before dictation recognizer session ends due to lack of audio input.</param>
/// <param name="recordingTime">Length in seconds for the manager to listen.</param>
/// <returns></returns>
public static IEnumerator StartRecording(float initialSilenceTimeout = 5f, float autoSilenceTimeout = 20f, int recordingTime = 10)
public static IEnumerator StartRecording(GameObject listener, float initialSilenceTimeout = 5f, float autoSilenceTimeout = 20f, int recordingTime = 10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if I'm using a global listener and I don't want/need to pass a specific GameObject in? Can we give listener a default value (probably null), like we've done with the others? That'd also prevent this from being a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question.

I don't think it's a good idea to make the object you're using to start the dictation a global listener.
But if you did, you'd have a script on the object that listens for the click handler:

OnInputClicked(EventData eventData)
{
    StartCoroutine(DictationManager.Instance.StartRecording(gameObject);
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I didn't mean the starting object being a global listener, but the one being sent the dictation results. If I want a button to start recording, but I want the results to be sent to a global listener (or two), my button would be forced to pass in some GameObject anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll make the listener optional.

@StephenHodgson StephenHodgson merged commit ee10c8a into microsoft:Dev_Working_Branch Feb 8, 2018
@StephenHodgson StephenHodgson deleted the MRTK-DictationFocus branch February 8, 2018 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants