SpeechConfig Class

Definition

Speech configuration.

public class SpeechConfig
type SpeechConfig = class
Public Class SpeechConfig
Inheritance
SpeechConfig
Derived

Properties

AuthorizationToken

Gets/sets the authorization token. Note: The caller needs to ensure that the authorization token is valid. Before the authorization token expires, the caller needs to refresh it by calling this setter with a new valid token. As configuration values are copied when creating a new recognizer, the new token value will not apply to recognizers that have already been created. For recognizers that have been created before, you need to set authorization token of the corresponding recognizer to refresh the token. Otherwise, the recognizers will encounter errors during recognition. Changed in version 1.3.0.

EndpointId

Sets the endpoint ID of a customized speech model that is used for speech recognition.

OutputFormat

Gets/sets the speech recognition output format: simple or detailed. Note: This output format is for speech recognition results, use SpeechSynthesisOutputFormat and SetSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat) to get/set synthesized audio output format.

Region

Region.

SpeechRecognitionLanguage

Specifies the name of spoken language to be recognized in BCP-47 format

SpeechSynthesisLanguage

Gets/sets the speech synthesis language, e.g. en-US Added in version 1.4.0

SpeechSynthesisOutputFormat

Gets the speech synthesis output format Added in version 1.4.0

SpeechSynthesisVoiceName

Gets/sets the speech synthesis voice name Added in version 1.4.0

SubscriptionKey

Subscription key.

Methods

EnableAudioLogging()

Enable audio logging in service. Added in version 1.5.0.

EnableDictation()

Enable dictation. Only supported in speech continuous recognition. Added in version 1.5.0.

FromAuthorizationToken(String, String)

Creates an instance of the speech config with specified authorization token and region. Note: The caller needs to ensure that the authorization token is valid. Before the authorization token expires, the caller needs to refresh it by calling this setter with a new valid token. As configuration values are copied when creating a new recognizer, the new token value will not apply to recognizers that have already been created. For recognizers that have been created before, you need to set authorization token of the corresponding recognizer to refresh the token. Otherwise, the recognizers will encounter errors during recognition.

FromEndpoint(Uri)

Creates an instance of the speech config with specified endpoint. This method is intended only for users who use a non-standard service endpoint or parameters. 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 the property SpeechRecognitionLanguage is set to "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, use FromEndpoint(System.Uri, string) to pass the subscription key as parameter. To use an authorization token with FromEndpoint, use this method to create a SpeechConfig instance, and then set the AuthorizationToken property on the created SpeechConfig instance. Note: Added in version 1.5.0.

FromEndpoint(Uri, String)

Creates an instance of the speech config with specified endpoint and subscription key. This method is intended only for users who use a non-standard service endpoint or parameters. 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 the property SpeechRecognitionLanguage is set to "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, use FromEndpoint(System.Uri), and then set the AuthorizationToken property on the created SpeechConfig instance.

FromHost(Uri)

Creates an instance of the speech 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(System.Uri, string) to pass the subscription key as parameter. To use an authorization token with FromHost, use this method to create a SpeechConfig instance, and then set the AuthorizationToken property on the created SpeechConfig instance. Note: Added in version 1.8.0.

FromHost(Uri, String)

Creates an instance of the speech config with specified host and subscription key. 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(System.Uri), and then set the AuthorizationToken property on the created SpeechConfig instance. Note: Added in version 1.8.0.

FromSubscription(String, String)

Creates an instance of speech configuration with specified subscription key and region.

GetProperty(PropertyId)

Gets the property by propertyId Added in version 1.3.0.

GetProperty(String)

Gets the property by name.

RequestWordLevelTimestamps()

Includes word-level timestamps. Added in version 1.5.0.

SetProfanity(ProfanityOption)

Sets profanity option. Added in version 1.5.0.

SetProperty(PropertyId, String)

Sets the property by propertyId Added in version 1.3.0.

SetProperty(String, String)

Sets the property by name.

SetProxy(String, Int32)

Sets proxy configuration. Added in version 1.3.0

SetProxy(String, Int32, String, String)

Sets proxy configuration. Added in version 1.1.0

Note: Proxy functionality is not available on macOS. This function will have no effect on this platform.

SetServiceProperty(String, String, ServicePropertyChannel)

Sets a property value that will be passed to service using the specified channel. Added in version 1.5.0.

SetSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat)

Sets the speech synthesis output format. Added in version 1.4.0

Applies to