SpeechConfig Class

Definition

Information about your subscription, including your key and region, endpoint, host, or authorization token.

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

Remarks

Calls to the Speech service require a SpeechConfig object.

There are a few ways that you can initialize a SpeechConfig:

  • Using : pass in a key and the associated region.
  • Using : pass in a Speech service endpoint. A key or authorization token is optional.
  • Using : pass in a host address. A key or authorization token is optional.

See also: Get started with speech-to-text

Properties

AuthorizationToken

Gets or sets the authorization token.

EndpointId

Gets or sets the endpoint ID of a custom speech model to use for speech recognition, or a custom voice model for speech synthesis.

OutputFormat

Gets/sets the speech recognition output format: simple or detailed.

Region

Region.

SpeechRecognitionLanguage

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

SpeechSynthesisLanguage

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

SpeechSynthesisOutputFormat

Gets the output format of synthesized speech. Added in version 1.4.0

Example value: riff-16khz-16bit-mono-pcm

SpeechSynthesisVoiceName

Gets or sets the speech synthesis voice. Added in version 1.4.0

SubscriptionKey

Subscription key.

Methods

EnableAudioLogging()

Enable audio logging in service. Audio logging writes log information and diagnostics to a local file. Added in version 1.5.0.

EnableDictation()

Enable dictation. Added in version 1.5.0.

FromAuthorizationToken(String, String)

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

FromEndpoint(Uri)

Creates an instance of the speech config with specified endpoint. Added in version 1.5.0.

FromEndpoint(Uri, String)

Creates an instance of SpeechConfig with specified endpoint and subscription key. This method is only used for a non-standard service endpoint or parameters.

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. Added in version 1.8.0.

FromHost(Uri, String)

Creates a SpeechConfig instance with a specific 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. Added in version 1.8.0.

FromSubscription(String, String)

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

See also: Get started with speech-to-text

GetProperty(PropertyId)

Gets the value of a property specified by a value in the enumeration. Added in version 1.3.0.

GetProperty(String)

For internal use.

RequestWordLevelTimestamps()

Include word-level timestamps. When audio logging is enabled, this method adds time details about the start point and duration of each word to the log. Added in version 1.5.0.

SetProfanity(ProfanityOption)

Sets profanity option. The profanity option can remove profane words, or replace their letters with stars. Added in version 1.5.0.

SetProperty(PropertyId, String)

Sets the value of a property specified by a value in the enumeration. Added in version 1.3.0.

SetProperty(String, String)

For internal use.

SetProxy(String, Int32)

Configures proxy. Added in version 1.3.0

SetProxy(String, Int32, String, String)

Configures proxy with username-password pair. 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)

For internal use. Enables preview of new service features.

SetSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat)

Sets the speech synthesis output format. Added in version 1.4.0

Applies to