Sdílet prostřednictvím


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 FromSubscription(String, String): pass in a key and the associated region. * Using FromEndpoint(Uri, String): pass in a Speech service endpoint. A key or authorization token is optional. * Using FromHost(Uri, String): 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 or 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 1.4.0

SpeechSynthesisOutputFormat

Gets the output format of synthesized speech. Added in 1.4.0

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

SpeechSynthesisVoiceName

Gets or sets the speech synthesis voice. Added in 1.4.0

SubscriptionKey

Subscription key.

Methods

EnableAudioLogging()

Enable audio and content logging in the service. Added in 1.5.0

EnableDictation()

Enable dictation during continuous recognition. Added in 1.5.0

FromAuthorizationToken(String, String)

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

FromEndpoint(Uri, String)

Creates an instance of SpeechConfig with a custom endpoint and subscription key.

FromEndpoint(Uri)

Creates an instance of the speech config with specified endpoint. Added in 1.5.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 1.8.0

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 1.

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)

Searches for the property named with this PropertyId enumeration. Added in 1.3.0

GetProperty(String)

Searches for the property that has this string name.

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 1.5.0

SetProfanity(ProfanityOption)

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

SetProperty(PropertyId, String)

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

SetProperty(String, String)

Sets a property using a string name.

SetProxy(String, Int32, String, String)

Configures proxy with username-password pair. Added in 1.1.0

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

SetProxy(String, Int32)

Configures proxy. Added in 1.3.0

SetServiceProperty(String, String, ServicePropertyChannel)

Enables preview of new service features.

SetSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat)

Sets the speech synthesis output format. Added in 1.4.0

Applies to