SpeechTranslationConfig Class

Class that defines configurations for translation with speech input.

The configuration can be initialized in different ways:

  • from subscription: pass a subscription key and a region

  • from endpoint: pass a subscription key and an endpoint

  • from host: pass a subscription key and a host address

  • from authorization token: pass an authorization token and a region

Inheritance
SpeechTranslationConfig

Constructor

SpeechTranslationConfig(subscription: Optional[str] = None, region: Optional[str] = None, endpoint: Optional[str] = None, host: Optional[str] = None, auth_token: Optional[str] = None, target_languages: Optional[Iterable[str]] = None, voice_name: str = '', speech_recognition_language: str = '')

Parameters

subscription
Required

The subscription key.

region
Required

The region name (see the region page).

endpoint
Required

The service endpoint to connect to.

host
Required

The service host to connect to. Standard resource path will be assumed. Format is "protocol://host:port" where ":port" is optional.

auth_token
Required

The authorization token.

speech_recognition_language
Required

The input language to the speech recognition. The language is specified in BCP-47 format.

target_languages
Required

The target languages for translation.

voice_name
Required

The voice to use for synthesized output.

Methods

add_target_language

Add language to the list of target languages for translation.

remove_target_language

Remove language from the list of target languages for translation.

Note

Added in version 1.7.0.

add_target_language

Add language to the list of target languages for translation.

add_target_language(language: str)

Parameters

language
Required

The language code to add.

remove_target_language

Remove language from the list of target languages for translation.

Note

Added in version 1.7.0.

remove_target_language(language: str)

Parameters

language
Required

The language code to remove.

Attributes

target_languages

The target languages for translation.

voice_name

The voice to use for synthesized output.