Class VoiceEvent¶
- java.lang.Object
-
- com.iristick.smartglass.core.VoiceEvent
public abstract class VoiceEvent extends Object
To receive such events, implement the VoiceEvent.Callback
interface and pass it to
Headset.registerVoiceCommands(java.lang.String[], com.iristick.smartglass.core.VoiceEvent.Callback, android.os.Handler)
.
Nested Class Summary¶
Modifier and Type | Class and Description |
---|---|
static interface |
VoiceEvent.Callback
Callback interface for voice command events.
|
Constructor Summary¶
Constructor and Description |
---|
VoiceEvent() |
Method Summary¶
Modifier and Type | Method and Description |
---|---|
abstract int |
getCommandIndex()
Deprecated.
Use
VoiceGrammar and getTags() instead. |
abstract List<Integer> |
getTags()
Returns the ordered list of tags for each recognized token in the voice command.
|
abstract List<String> |
getTokens()
Returns the ordered list of recognized tokens in the voice command.
|
Methods inherited from class java.lang.Object¶
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail¶
VoiceEvent¶
public VoiceEvent()
Method Detail¶
getCommandIndex¶
@CheckResult @Deprecated public abstract int getCommandIndex()
VoiceGrammar
and getTags()
instead.Return the index of the recognized voice command in the array of voice commands registered
with Headset.registerVoiceCommands(java.lang.String[], com.iristick.smartglass.core.VoiceEvent.Callback, android.os.Handler)
.
- Returns:
- The index of the recognized voice command.
getTokens¶
@CheckResult @NonNull public abstract List<String> getTokens()
Returns the ordered list of recognized tokens in the voice command.
If the voice commands were registered as an array of strings with
Headset.registerVoiceCommands(java.lang.String[], com.iristick.smartglass.core.VoiceEvent.Callback, android.os.Handler)
,
this list contains only a single value.
- Returns:
- The ordered list of recognized tokens that make up the voice command.
getTags¶
@CheckResult @NonNull public abstract List<Integer> getTags()
Returns the ordered list of tags for each recognized token in the voice command.
If the voice commands were registered as an array of strings with
Headset.registerVoiceCommands(java.lang.String[], com.iristick.smartglass.core.VoiceEvent.Callback, android.os.Handler)
,
this list contains only a single value: the command index.
- Returns:
- The ordered list of tags of recognized tokens that make up the voice command.
- See Also:
VoiceGrammar.Builder.addToken(String, int)