Edytuj

Udostępnij za pośrednictwem


DictationHandler Class

Definition

Script used to start and stop recording sessions in the current dictation system and report the transcribed text via UnityEvents. 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.

public ref class DictationHandler : Microsoft::MixedReality::Toolkit::Input::BaseInputHandler, Microsoft::MixedReality::Toolkit::Input::IMixedRealityDictationHandler, UnityEngine::EventSystems::IEventSystemHandler
[UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/DictationHandler")]
public class DictationHandler : Microsoft.MixedReality.Toolkit.Input.BaseInputHandler, Microsoft.MixedReality.Toolkit.Input.IMixedRealityDictationHandler, UnityEngine.EventSystems.IEventSystemHandler
[<UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/DictationHandler")>]
type DictationHandler = class
    inherit BaseInputHandler
    interface IMixedRealityDictationHandler
    interface IEventSystemHandler
Public Class DictationHandler
Inherits BaseInputHandler
Implements IEventSystemHandler, IMixedRealityDictationHandler
Inheritance
UnityEngine.MonoBehaviour
DictationHandler
Attributes
UnityEngine.AddComponentMenuAttribute
Implements
IMixedRealityDictationHandler UnityEngine.EventSystems.IEventSystemHandler

Constructors

DictationHandler()

Fields

OnDictationComplete

Event raised when the recognizer stops. Contains the final recognized string.

OnDictationError

Event raised when an error occurs. Contains the string representation of the error reason.

OnDictationHypothesis

Event raised while the user is talking. As the recognizer listens, it provides text of what it's heard so far.

OnDictationResult

Event raised after the user pauses, typically at the end of a sentence. Contains the full recognized string so far.

Properties

AudioClip

Get the last audio clip from the dictation session

IsFocusRequired

Is Focus required to receive input events on this GameObject?

(Inherited from BaseInputHandler)
IsListening

Get the listening state

Methods

EnsureInputSystemValid()

A task that will only complete when the input system has in a valid state.

(Inherited from InputSystemGlobalHandlerListener)
OnDisable()
OnEnable() (Inherited from BaseInputHandler)
RegisterHandlers()

Overload this method to specify, which global events component wants to listen to. Use RegisterHandler API of InputSystem

Start()
StartRecording()

Start a recording session in the dictation system.

StopRecording()

Stop a recording session in the dictation system.

UnregisterHandlers()

Overload this method to specify, which global events component should stop listening to. Use UnregisterHandler API of InputSystem

Update() (Inherited from BaseInputHandler)

Explicit Interface Implementations

IMixedRealityDictationHandler.OnDictationComplete(DictationEventData)
IMixedRealityDictationHandler.OnDictationError(DictationEventData)
IMixedRealityDictationHandler.OnDictationHypothesis(DictationEventData)
IMixedRealityDictationHandler.OnDictationResult(DictationEventData)

Applies to