EmbeddedSpeechConfig Class

Class that defines embedded (offline) speech configuration.

Constructor

EmbeddedSpeechConfig(path: str | None = None, paths: List[str] | None = None)

Parameters

Name Description
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.

Default value: None
paths

A list of 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.

Default value: None

Methods

from_path

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

from_paths

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

get_property

Get a property by id.

get_property_by_name

Get a property by name.

get_speech_recognition_models

Gets a list of available speech recognition models.

get_speech_translation_models

Gets a list of available speech translation models.

set_keyword_recognition_model

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

set_profanity

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

set_property

Set a property by id.

set_property_by_name

Set a property by name.

set_speech_recognition_model

Sets the model for speech recognition.

set_speech_synthesis_output_format

Sets the speech synthesis output audio format.

set_speech_synthesis_voice

Sets the voice for embedded speech synthesis.

set_speech_translation_model

Sets the model for speech translation.

from_path

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

from_path(path: str) -> EmbeddedSpeechConfig

Parameters

Name Description
path
Required

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

Type Description

An EmbeddedSpeechConfig instance.

from_paths

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

from_paths(paths: List[str]) -> EmbeddedSpeechConfig

Parameters

Name Description
paths
Required

The 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

Type Description

An EmbeddedSpeechConfig instance.

get_property

Get a property by id.

get_property(property_id: PropertyId) -> str

Parameters

Name Description
property_id
Required

The id of the property to be retrieved.

Returns

Type Description

The value of the property.

get_property_by_name

Get a property by name.

get_property_by_name(property_name: str) -> str

Parameters

Name Description
property_name
Required

The name of the property to be retrieved.

Returns

Type Description

The value of the property.

get_speech_recognition_models

Gets a list of available speech recognition models.

get_speech_recognition_models() -> List[SpeechRecognitionModelInfo]

Returns

Type Description

The list of speech recognition models.

get_speech_translation_models

Gets a list of available speech translation models.

get_speech_translation_models() -> List[SpeechTranslationModelInfo]

Returns

Type Description

The list of speech translation models.

set_keyword_recognition_model

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

set_keyword_recognition_model(name: str, license: str)

Parameters

Name Description
name
Required

The model name.

license
Required

The license text.

set_profanity

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

set_profanity(profanity_option: ProfanityOption) -> None

Parameters

Name Description
profanity_option
Required

The profanity level to set.

set_property

Set a property by id.

set_property(property_id: PropertyId, value: str)

Parameters

Name Description
property_id
Required

The id of the property to be set.

value
Required

The value to be set for the property.

set_property_by_name

Set a property by name.

set_property_by_name(property_name: str, value: str)

Parameters

Name Description
property_name
Required

The name of the property to be set.

value
Required

The value to be set for the property.

set_speech_recognition_model

Sets the model for speech recognition.

set_speech_recognition_model(name: str, license: str)

Parameters

Name Description
name
Required

The model name.

license
Required

The license text.

set_speech_synthesis_output_format

Sets the speech synthesis output audio format.

set_speech_synthesis_output_format(format_id: SpeechSynthesisOutputFormat)

Parameters

Name Description
format_id
Required

The audio format id, e.g. Riff16Khz16BitMonoPcm.

set_speech_synthesis_voice

Sets the voice for embedded speech synthesis.

set_speech_synthesis_voice(name: str, license: str)

Parameters

Name Description
name
Required

The voice name of the embedded speech synthesis.

license
Required

The license text.

set_speech_translation_model

Sets the model for speech translation.

set_speech_translation_model(name: str, license: str)

Parameters

Name Description
name
Required

The model name.

license
Required

The license text.

Attributes

keyword_recognition_model_name

Gets the model name for keyword recognition.

speech_recognition_model_name

Gets the model name for speech recognition.

speech_recognition_output_format

The speech recognition output format (simple or detailed).

speech_synthesis_output_format_string

Gets the speech synthesis output audio format string.

speech_synthesis_voice_name

Gets the voice name for embedded speech synthesis.

speech_translation_model_name

Gets the model name for speech translation.