You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright (c) Microsoft Corporation. All rights reserved.
2
+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3
+
4
+
usingUnityEngine;
5
+
usingUnityEngine.Events;
6
+
7
+
namespaceMicrosoft.MixedReality.Toolkit.Input
8
+
{
9
+
/// <summary>
10
+
/// Script used to start and stop recording sessions in the current dictation system and report the transcribed text via UnityEvents.
11
+
/// For this script to work, a dictation system like 'Windows Dictation Input Provider' must be added to the Data Providers in the Input System profile.
[Tooltip("Time length in seconds before the dictation session ends due to lack of audio input in case there was no audio heard in the current session")]
17
+
privatefloatinitialSilenceTimeout=5f;
18
+
19
+
[SerializeField]
20
+
[Tooltip("Time length in seconds before the dictation session ends due to lack of audio input.")]
21
+
privatefloatautoSilenceTimeout=20f;
22
+
23
+
[SerializeField]
24
+
[Tooltip("Length in seconds for the dictation service to listen")]
25
+
privateintrecordingTime=10;
26
+
27
+
[SerializeField]
28
+
[Tooltip("Whether recording should start automatically on start")]
29
+
privateboolstartRecordingOnStart=false;
30
+
31
+
[System.Serializable]
32
+
publicclassStringUnityEvent:UnityEvent<string>{}
33
+
34
+
/// <summary>
35
+
/// Event raised while the user is talking. As the recognizer listens, it provides text of what it's heard so far.
36
+
/// </summary>
37
+
publicStringUnityEventOnDictationHypothesis;
38
+
39
+
/// <summary>
40
+
/// Event raised after the user pauses, typically at the end of a sentence. Contains the full recognized string so far.
41
+
/// </summary>
42
+
publicStringUnityEventOnDictationResult;
43
+
44
+
/// <summary>
45
+
/// Event raised when the recognizer stops. Contains the final recognized string.
46
+
/// </summary>
47
+
publicStringUnityEventOnDictationComplete;
48
+
49
+
/// <summary>
50
+
/// Event raised when an error occurs. Contains the string representation of the error reason.
Debug.Assert(dictationSystem!=null,"No dictation system found. In order to use dictation, add a dictation system like 'Windows Dictation Input Provider' to the Data Providers in the Input System profile");
0 commit comments