class Translation::SpeechTranslationConfig

class Translation::SpeechTranslationConfig
  : public SpeechConfig

Class that defines configurations for translation with speech input.

Members

AddTargetLanguage

Syntax: public inline void AddTargetLanguage ( const std::string & language );

Adds a target language for translation.

Parameters

  • language Translation target language to add.

RemoveTargetLanguage

Syntax: public inline void RemoveTargetLanguage ( const std::string & language );

Removes a target language for translation. Added in release 1.7.0.

Parameters

  • language Translation target language to remove.

SetCustomModelCategoryId

Syntax: public inline void SetCustomModelCategoryId ( const std::string & categoryId );

Sets a Category Id that will be passed to service. Category Id is used to find the custom model.

Parameters

  • categoryId Category Id to set.

GetTargetLanguages

Syntax: public inline std::vector< std::string > GetTargetLanguages ( ) const;

Gets target languages for translation.

Returns

Vector of translation target languages.

SetVoiceName

Syntax: public inline void SetVoiceName ( const std::string & voice );

Sets output voice name.

Parameters

  • voice Voice name to set.

GetVoiceName

Syntax: public inline std::string GetVoiceName ( ) const;

Gets output voice name.

Returns

Output voice name.

FromSubscription

Syntax: public inline static std::shared_ptr< SpeechTranslationConfig > FromSubscription ( const std::string & subscription , const std::string & region );

Creates an instance of the speech translation config with specified subscription key and region.

Parameters

  • subscription The subscription key.

  • region The region name (see the region page).

Returns

Shared pointer to the speech translation config instance.

FromAuthorizationToken

Syntax: public inline static std::shared_ptr< SpeechTranslationConfig > FromAuthorizationToken ( const std::string & authToken , const std::string & region );

Creates an instance of the speech translation config with specified authorization token and region.

Parameters

  • authToken The authorization token.

  • region The region name (see the region page).

Returns

Shared pointer to the speech translation config instance.

FromEndpoint

Syntax: public inline static std::shared_ptr< SpeechTranslationConfig > FromEndpoint ( const std::string & endpoint , const std::string & subscription );

Creates an instance of the speech translation config with specified endpoint and subscription. This method is intended only for users who use a non-standard service endpoint. Note: The query parameters specified in the endpoint URI are not changed, even if they are set by any other APIs. For example, if the recognition language is defined in URI as query parameter "language=de-DE", and also set by SetSpeechRecognitionLanguage("en-US"), the language setting in URI takes precedence, and the effective language is "de-DE". Only the parameters that are not specified in the endpoint URI can be set by other APIs. Note: To use an authorization token with FromEndpoint, please use FromEndpoint(const SPXSTRING&), and then call SetAuthorizationToken() on the created SpeechTranslationConfig instance.

Parameters

  • endpoint The service endpoint to connect to.

  • subscription The subscription key.

Returns

Shared pointer to the new SpeechTranslationConfig instance.

FromEndpoint

Syntax: public inline static std::shared_ptr< SpeechTranslationConfig > FromEndpoint ( const std::string & endpoint );

Creates an instance of the speech translation config with specified endpoint. This method is intended only for users who use a non-standard service endpoint. Note: The query parameters specified in the endpoint URI are not changed, even if they are set by any other APIs. For example, if the recognition language is defined in URI as query parameter "language=de-DE", and also set by SetSpeechRecognitionLanguage("en-US"), the language setting in URI takes precedence, and the effective language is "de-DE". Only the parameters that are not specified in the endpoint URI can be set by other APIs. Note: if the endpoint requires a subscription key for authentication, please use FromEndpoint(const SPXSTRING&, const SPXSTRING&) to pass the subscription key as parameter. To use an authorization token with FromEndpoint, use this method to create a SpeechTranslationConfig instance, and then call SetAuthorizationToken() on the created SpeechTranslationConfig instance. Note: Added in version 1.5.0.

Parameters

  • endpoint The service endpoint to connect to.

Returns

A shared pointer to the new SpeechTranslationConfig instance.

FromHost

Syntax: public inline static std::shared_ptr< SpeechTranslationConfig > FromHost ( const std::string & host , const std::string & subscription );

Creates an instance of the speech translation config with specified host and subscription. This method is intended only for users who use a non-default service host. Standard resource path will be assumed. For services with a non-standard resource path or no path at all, use FromEndpoint instead. Note: Query parameters are not allowed in the host URI and must be set by other APIs. Note: To use an authorization token with FromHost, use FromHost(const SPXSTRING&), and then call SetAuthorizationToken() on the created SpeechTranslationConfig instance. Note: Added in version 1.8.0.

Parameters

  • host The service host to connect to. Format is "protocol://host:port" where ":port" is optional.

  • subscription The subscription key.

Returns

Shared pointer to the new SpeechTranslationConfig instance.

FromHost

Syntax: public inline static std::shared_ptr< SpeechTranslationConfig > FromHost ( const std::string & host );

Creates an instance of the speech translation config with specified host. This method is intended only for users who use a non-default service host. Standard resource path will be assumed. For services with a non-standard resource path or no path at all, use FromEndpoint instead. Note: Query parameters are not allowed in the host URI and must be set by other APIs. Note: If the host requires a subscription key for authentication, use FromHost(const SPXSTRING&, const SPXSTRING&) to pass the subscription key as parameter. To use an authorization token with FromHost, use this method to create a SpeechTranslationConfig instance, and then call SetAuthorizationToken() on the created SpeechTranslationConfig instance. Note: Added in version 1.8.0.

Parameters

  • host The service host to connect to. Format is "protocol://host:port" where ":port" is optional.

Returns

A shared pointer to the new SpeechTranslationConfig instance.