EmbeddedSpeechConfig Class

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

Implements

java.lang.AutoCloseable

public final class EmbeddedSpeechConfig
implements java.lang.AutoCloseable

Class that defines embedded (offline) speech configuration. 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 EmbeddedSpeechConfig fromPath(String path)

Creates an instance of the embedded speech config with a specified offline model path.

static final EmbeddedSpeechConfig fromPaths(List<String> paths)

Creates an instance of the embedded speech config with specified offline model paths.

SafeHandle getImpl()

Returns a internal handle to SpeechConfig implementation.

final java.lang.String getKeywordRecognitionModelName()

Gets the model name for keyword recognition.

java.lang.String getProperty(PropertyId id)

Gets the property by propertyId.

java.lang.String getProperty(String name)

Gets a named property as value.

final java.lang.String getSpeechRecognitionModelName()

Gets the model name for speech recognition.

final java.util.List<SpeechRecognitionModel> getSpeechRecognitionModels()

Gets a list of available speech recognition models.

final OutputFormat getSpeechRecognitionOutputFormat()

Gets the embedded speech recognition output format.

final java.lang.String getSpeechSynthesisOutputFormat()

Gets the embedded speech synthesis output format.

final java.lang.String getSpeechSynthesisVoiceName()

Gets the voice name for embedded speech synthesis.

final java.lang.String getSpeechTranslationModelName()

Gets the model name for speech translation.

final java.util.List<SpeechTranslationModel> getSpeechTranslationModels()

Gets a list of available speech translation models.

final void setKeywordRecognitionModel(String name, String key)

Sets the model for keyword recognition.

final void setProfanity(ProfanityOption value)

Sets the profanity option.

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 setSpeechRecognitionModel(String name, String key)

Sets the model for speech recognition.

final void setSpeechRecognitionOutputFormat(OutputFormat value)

Sets the speech recognition output format.

final void setSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat value)

Sets the embedded speech synthesis output format.

final void setSpeechSynthesisVoice(String name, String key)

Sets the voice for speech synthesis.

final void setSpeechTranslationModel(String name, String key)

Sets the model for speech translation.

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.

fromPath

public static final EmbeddedSpeechConfig fromPath(String path)

Creates an instance of the embedded speech config with a specified offline model path.

Parameters:

path - The folder path to search for offline models. This can be a root path under which several models are located in subfolders, or a direct path to a specific model folder.

Returns:

An embedded speech config instance.

fromPaths

public static final EmbeddedSpeechConfig fromPaths(List paths)

Creates an instance of the embedded speech config with specified offline model paths.

Parameters:

paths - he folder paths to search for offline models. These can be root paths under which several models are located in subfolders, or direct paths to specific model folders.

Returns:

An embedded speech config instance.

getImpl

public SafeHandle getImpl()

Returns a internal handle to SpeechConfig implementation.

Returns:

The implementation handle.

getKeywordRecognitionModelName

public final String getKeywordRecognitionModelName()

Gets the model name for keyword recognition.

Returns:

The keyword recognition model name.

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.

getSpeechRecognitionModelName

public final String getSpeechRecognitionModelName()

Gets the model name for speech recognition.

Returns:

The recognition model name.

getSpeechRecognitionModels

public final List getSpeechRecognitionModels()

Gets a list of available speech recognition models.

Returns:

Speech recognition model info.

getSpeechRecognitionOutputFormat

public final OutputFormat getSpeechRecognitionOutputFormat()

Gets the embedded speech recognition output format.

Returns:

The recognition output format.

getSpeechSynthesisOutputFormat

public final String getSpeechSynthesisOutputFormat()

Gets the embedded speech synthesis output format.

Returns:

Returns the synthesis output format.

getSpeechSynthesisVoiceName

public final String getSpeechSynthesisVoiceName()

Gets the voice name for embedded speech synthesis.

Returns:

Returns the embedded speech synthesis voice name.

getSpeechTranslationModelName

public final String getSpeechTranslationModelName()

Gets the model name for speech translation.

Returns:

The translation model name.

getSpeechTranslationModels

public final List getSpeechTranslationModels()

Gets a list of available speech translation models.

Returns:

Speech translation model info.

setKeywordRecognitionModel

public final void setKeywordRecognitionModel(String name, String key)

Sets the model for keyword recognition. This is for customer specific models that are tailored for detecting wake words and direct commands.

Parameters:

name - Model name.
key - Model decryption key.

setProfanity

public final void setProfanity(ProfanityOption value)

Sets the profanity option. This can be used to remove profane words or mask them in output.

Parameters:

value - The profanity option.

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.

setSpeechRecognitionModel

public final void setSpeechRecognitionModel(String name, String key)

Sets the model for speech recognition.

Parameters:

name - The model name.
key - The model decryption key.

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 embedded speech synthesis output format.

Parameters:

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

setSpeechSynthesisVoice

public final void setSpeechSynthesisVoice(String name, String key)

Sets the voice for speech synthesis.

Parameters:

name - The voice name for embedded speech synthesis.
key - The decryption key.

setSpeechTranslationModel

public final void setSpeechTranslationModel(String name, String key)

Sets the model for speech translation.

Parameters:

name - Model name.
key - Model decryption key.

Applies to