SpeechSynthesisResult Class

  • java.lang.Object
    • com.microsoft.cognitiveservices.speech.SpeechSynthesisResult

Implements

java.lang.AutoCloseable

public class SpeechSynthesisResult
implements java.lang.AutoCloseable

Contains detailed information about result of a speech synthesis operation. Note: close() must be called in order to release underlying resources held by the object. Added in version 1.7.0

Constructor Summary

Modifier Constructor Description
protected SpeechSynthesisResult(IntRef result)

PROTECTED

Method Summary

Modifier and Type Method and Description
void close()

Explicitly frees any external resource attached to the object

byte[] getAudioData()

Gets the synthesized audio from the result.

long getAudioDuration()

Gets the time duration of synthesized audio, by ticks (100ns).

long getAudioLength()

Gets the size of synthesized audio in bytes.

SafeHandle getImpl()

Returns the synthesis result implementation.

PropertyCollection getProperties()

The set of properties exposed in the result.

ResultReason getReason()

Gets the reason the result was created.

java.lang.String getResultId()

Gets the unique ID of the result.

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

SpeechSynthesisResult

protected SpeechSynthesisResult(IntRef result)

PROTECTED

Parameters:

result - PROTECTED

Method Details

close

public void close()

Explicitly frees any external resource attached to the object

getAudioData

public byte[] getAudioData()

Gets the synthesized audio from the result.

Returns:

Synthesized audio.

getAudioDuration

public long getAudioDuration()

Gets the time duration of synthesized audio, by ticks (100ns). Only valid for completed synthesis.

Returns:

Time duration of synthesized audio, by ticks (100ns).

getAudioLength

public long getAudioLength()

Gets the size of synthesized audio in bytes.

Returns:

Length of synthesized audio.

getImpl

public SafeHandle getImpl()

Returns the synthesis result implementation.

Returns:

The implementation of the result.

getProperties

public PropertyCollection getProperties()

The set of properties exposed in the result.

Returns:

The set of properties exposed in the result.

getReason

public ResultReason getReason()

Gets the reason the result was created.

Returns:

Specifies reason of the result.

getResultId

public String getResultId()

Gets the unique ID of the result.

Returns:

Specifies unique ID of the result.

Applies to