KeywordRecognizer Class

Definition

Performs keyword recognition on the speech input. Note: close() must be called in order to release underlying resources held by the object.

public class KeywordRecognizer
Inheritance
java.lang.Object
AutoCloseable
KeywordRecognizer

Constructors

KeywordRecognizer(com.microsoft.cognitiveservices.speech.audio.AudioConfig audioConfig)

Creates a new instance of a keyword recognizer. If no audio config is provided as input parameter, it will be equivalent to calling with a config constructed with AudioConfig::FromDefaultMicrophoneInput.

Fields

canceled

The signal for events relating to the cancellation of an interaction. The event indicates if the reason is a direct cancellation or an error.

recognized

The signal for events related to the recognition of keywords

Methods

close()

Dispose of associated resources. Note: close() must be called in order to release underlying resources held by the object.

getProperties()

The collection of properties and their values defined for KeywordRecognizer.

recognizeOnceAsync(final KeywordRecognitionModel model)

Starts a keyword recognition session. This session will last until the first keyword is recognized. When this happens, Recognized event will be raised and the session will end. To rearm the keyword, the method needs to be called again after the event is emitted. Note: If no keyword is detected in the input, the task will never resolve unless StopRecognition method is called.

stopRecognitionAsync()

Stops a currently active keyword recognition session.

Applies to