Struct VoiceControlCommand
Phrase/callback pair.
Namespace: Recognissimo.Components
Assembly: Recognissimo.dll
Syntax
[Serializable]
public struct VoiceControlCommand
Constructors
VoiceControlCommand(String, UnityAction)
Create instance and bind action
to onSpoken.
Declaration
public VoiceControlCommand(string phrase, UnityAction action)
Parameters
Type | Name | Description |
---|---|---|
System.String | phrase | Phrase to recognize. |
UnityEngine.Events.UnityAction | action | Action that will be triggered when the |
VoiceControlCommand(String, UnityEvent)
Create instance.
Declaration
public VoiceControlCommand(string phrase, UnityEvent onSpoken)
Parameters
Type | Name | Description |
---|---|---|
System.String | phrase | Phrase to recognize. |
UnityEngine.Events.UnityEvent | onSpoken | Unity event that will be triggered when the |
Fields
onSpoken
UnityEvent that will be triggered when the phrase is spoken.
Declaration
public UnityEvent onSpoken
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent |
phrase
Phrase to recognize. You can use groups "()" and alternations "|" to create options:
"red|green"; // triggered when "red" or "green" is spoken
"turn (on|off) the light"; // triggered when "turn on the light" or "turn off the light" is spoken
"turn (on|off) (the )?light"; // optional "the"
Declaration
[Tooltip("Phrase to recognize")]
public string phrase
Field Value
Type | Description |
---|---|
System.String |