class EmbeddedSpeechConfig
Class that defines embedded (offline) speech configuration.
Members
operator SPXSPEECHCONFIGHANDLE
Syntax: public inline explicit operator SPXSPEECHCONFIGHANDLE ( ) const;
Internal operator used to get the underlying handle value.
Returns
A handle.
GetSpeechRecognitionModels
Syntax: public inline std::vector< std::shared_ptr< SpeechRecognitionModel > > GetSpeechRecognitionModels ( );
Gets a list of available speech recognition models.
Returns
Speech recognition model info.
SetSpeechRecognitionModel
Syntax: public inline void SetSpeechRecognitionModel ( const std::string & name , const std::string & key );
Sets the model for speech recognition.
Parameters
name
The model name.key
The model decryption key.
GetSpeechRecognitionModelName
Syntax: public inline std::string GetSpeechRecognitionModelName ( ) const;
Gets the model name for speech recognition.
Returns
The speech recognition model name.
SetSpeechRecognitionOutputFormat
Syntax: public inline void SetSpeechRecognitionOutputFormat ( OutputFormat format );
Sets the speech recognition output format.
Parameters
format
Speech recognition output format (simple or detailed).
GetSpeechRecognitionOutputFormat
Syntax: public inline OutputFormat GetSpeechRecognitionOutputFormat ( ) const;
Gets the speech recognition output format.
Returns
Speech recognition output format (simple or detailed).
SetProfanity
Syntax: public inline void SetProfanity ( ProfanityOption profanity );
Sets the profanity option. This can be used to remove profane words or mask them.
Parameters
profanity
Profanity option value.
SetSpeechSynthesisVoice
Syntax: public inline void SetSpeechSynthesisVoice ( const std::string & name , const std::string & key );
Sets the voice for embedded speech synthesis.
Parameters
name
The voice name of the embedded speech synthesis.key
The decryption key.
GetSpeechSynthesisVoiceName
Syntax: public inline std::string GetSpeechSynthesisVoiceName ( ) const;
Gets the voice name for embedded speech synthesis.
Returns
The speech synthesis model name, i.e. the voice name.
SetSpeechSynthesisOutputFormat
Syntax: public inline void SetSpeechSynthesisOutputFormat ( SpeechSynthesisOutputFormat formatId );
Sets the speech synthesis output format (e.g. Riff16Khz16BitMonoPcm).
Parameters
formatId
Specifies the output format ID
GetSpeechSynthesisOutputFormat
Syntax: public inline std::string GetSpeechSynthesisOutputFormat ( ) const;
Gets the speech synthesis output format.
Returns
The speech synthesis output format.
GetSpeechTranslationModels
Syntax: public inline std::vector< std::shared_ptr< SpeechTranslationModel > > GetSpeechTranslationModels ( );
Gets a list of available speech translation models.
Returns
Speech translation model info.
SetSpeechTranslationModel
Syntax: public inline void SetSpeechTranslationModel ( const std::string & name , const std::string & key );
Sets the model for speech translation.
Parameters
name
Model name.key
Model decryption key.
GetSpeechTranslationModelName
Syntax: public inline std::string GetSpeechTranslationModelName ( ) const;
Gets the model name for speech translation.
Returns
The speech translation model name.
SetKeywordRecognitionModel
Syntax: public inline void SetKeywordRecognitionModel ( const std::string & name , const std::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.
GetKeywordRecognitionModelName
Syntax: public inline std::string GetKeywordRecognitionModelName ( ) const;
Gets the model name for keyword recognition.
Returns
The keyword recognition model name.
SetProperty
Syntax: public inline void SetProperty ( const std::string & name , const std::string & value );
Sets a property value by name.
Parameters
name
The property name.value
The property value.
SetProperty
Syntax: public inline void SetProperty ( PropertyId id , const std::string & value );
Sets a property value by ID.
Parameters
id
The property id.value
The property value.
GetProperty
Syntax: public inline std::string GetProperty ( const std::string & name ) const;
Gets a property value by name.
Parameters
name
The parameter name.
Returns
The property value.
GetProperty
Syntax: public inline std::string GetProperty ( PropertyId id ) const;
Gets a property value by ID.
Parameters
id
The parameter id.
Returns
The property value.
~EmbeddedSpeechConfig
Syntax: public virtual ~EmbeddedSpeechConfig ( ) = default;
Destructs the object.
FromPath
Syntax: public inline static std::shared_ptr< EmbeddedSpeechConfig > FromPath ( const std::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
A shared pointer to the new embedded speech config instance.
FromPaths
Syntax: public inline static std::shared_ptr< EmbeddedSpeechConfig > FromPaths ( const std::vector< std::string > & paths );
Creates an instance of the embedded speech config with specified offline model paths.
Parameters
paths
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
A shared pointer to the new embedded speech config instance.