Delen via


SpeakerRecognizer Class

  • java.lang.Object
    • com.microsoft.cognitiveservices.speech.speaker.SpeakerRecognizer

Implements

java.lang.AutoCloseable

public final class SpeakerRecognizer
implements java.lang.AutoCloseable

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

Constructor Summary

Constructor Description
SpeakerRecognizer(SpeechConfig speechConfig, AudioConfig audioConfig)

Creates a new instance of a speaker recognizer.

Method Summary

Modifier and Type Method and Description
void close()

Dispose of associated resources.

SafeHandle getImpl()

Internal method to get the underlying native handle.

PropertyCollection getProperties()

The collection of properties and their values defined for SpeakerRecognizer.

java.util.concurrent.Future<SpeakerRecognitionResult> recognizeOnceAsync(SpeakerIdentificationModel model)

Starts a speaker recognition session to identify the speaker in the identification model.

java.util.concurrent.Future<SpeakerRecognitionResult> recognizeOnceAsync(SpeakerVerificationModel model)

Starts a speaker recognition session to verify the speaker in the verification model.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SpeakerRecognizer

public SpeakerRecognizer(SpeechConfig speechConfig, AudioConfig audioConfig)

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

Parameters:

speechConfig - speech configuration.
audioConfig - audio configuration.

Method Details

close

public void close()

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

getImpl

public SafeHandle getImpl()

Internal method to get the underlying native handle.

Returns:

the native handle to the underlying object.

getProperties

public PropertyCollection getProperties()

The collection of properties and their values defined for SpeakerRecognizer.

Returns:

The collection of properties and their values defined for SpeakerRecognizer.

recognizeOnceAsync

public Future recognizeOnceAsync(SpeakerIdentificationModel model)

Starts a speaker recognition session to identify the speaker in the identification model.

Parameters:

model - The speaker identification model that specifies the speaker to be identified.

Returns:

A task representing the speaker recognition operation. The task returns an instance of SpeakerRecognitionResult.

recognizeOnceAsync

public Future recognizeOnceAsync(SpeakerVerificationModel model)

Starts a speaker recognition session to verify the speaker in the verification model.

Parameters:

model - The speaker verification model that specifies the speaker to be verified.

Returns:

A task representing the speaker recognition operation. The task returns an instance of SpeakerRecognitionResult.

Applies to