HybridSpeechConfig Class

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

Implements

java.lang.AutoCloseable

public final class HybridSpeechConfig
implements java.lang.AutoCloseable

Class that defines hybrid (cloud and embedded) configurations for speech recognition and speech synthesis. Note: close() must be called in order to release underlying resources held by the object.

Method Summary

Modifier and Type Method and Description
final void close()

Dispose of associated resources.

static final HybridSpeechConfig fromConfigs(SpeechConfig cloudSpeechConfig, EmbeddedSpeechConfig embeddedSpeechConfig)

Creates an instance of the hybrid speech config with specified cloud and embedded speech configs.

SafeHandle getImpl()

Returns a internal handle to SpeechConfig implementation.

java.lang.String getProperty(PropertyId id)

Gets the property by propertyId.

java.lang.String getProperty(String name)

Gets a named property as value.

final OutputFormat getSpeechRecognitionOutputFormat()

Gets the speech recognition output format.

final java.lang.String getSpeechSynthesisOutputFormat()

Gets the speech synthesis output format.

void setProperty(PropertyId id, String value)

Sets the property by propertyId.

void setProperty(String name, String value)

Sets a named property as value.

final void setSpeechRecognitionOutputFormat(OutputFormat value)

Sets the speech recognition output format.

final void setSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat value)

Sets the speech synthesis output format.

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

Method Details

close

public final void close()

Dispose of associated resources.

fromConfigs

public static final HybridSpeechConfig fromConfigs(SpeechConfig cloudSpeechConfig, EmbeddedSpeechConfig embeddedSpeechConfig)

Creates an instance of the hybrid speech config with specified cloud and embedded speech configs.

Parameters:

cloudSpeechConfig - Cloud speech configuration.
embeddedSpeechConfig - Embedded speech configuration.

Returns:

A hybrid speech config instance.

getImpl

public SafeHandle getImpl()

Returns a internal handle to SpeechConfig implementation.

Returns:

The implementation handle.

getProperty

public String getProperty(PropertyId id)

Gets the property by propertyId.

Parameters:

id - PropertyId of the property.

Returns:

The value.

getProperty

public String getProperty(String name)

Gets a named property as value.

Parameters:

name - the name of the property.

Returns:

The value.

getSpeechRecognitionOutputFormat

public final OutputFormat getSpeechRecognitionOutputFormat()

Gets the speech recognition output format.

Returns:

The recognition output format.

getSpeechSynthesisOutputFormat

public final String getSpeechSynthesisOutputFormat()

Gets the speech synthesis output format.

Returns:

Returns the synthesis output format.

setProperty

public void setProperty(PropertyId id, String value)

Sets the property by propertyId.

Parameters:

id - PropertyId of the property.
value - The value.

setProperty

public void setProperty(String name, String value)

Sets a named property as value.

Parameters:

name - the name of the property.
value - the value.

setSpeechRecognitionOutputFormat

public final void setSpeechRecognitionOutputFormat(OutputFormat value)

Sets the speech recognition output format.

Parameters:

value - The recognition output format.

setSpeechSynthesisOutputFormat

public final void setSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat value)

Sets the speech synthesis output format.

Parameters:

value - The synthesis output format ID (e.g. Riff16Khz16BitMonoPcm).

Applies to