pub struct SpeechConfig {
    pub handle: SmartHandle<SPXSPEECHCONFIGHANDLE>,
    /* private fields */
}
Expand description

SpeechConfig is the class that defines configurations for speech / intent recognition, or speech synthesis.

Fields

handle: SmartHandle<SPXSPEECHCONFIGHANDLE>

Implementations

Creates a SpeechConfig instance from a valid handle. This is for internal use only.

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

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.

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 endoint, use FromEndpoint, and then call SetAuthorizationToken() on the created SpeechConfig instance.

Creates an instance of SpeechConfig 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, use NewSpeechConfigFromEndpointWithSubscription to pass the subscription key as parameter. To use an authorization token with FromEndpoint, use this method to create a SpeechConfig instance, and then call SetAuthorizationToken() on the created SpeechConfig instance.

Creates an instance of the speech 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 host, use NewSpeechConfigFromHost, and then call SetAuthorizationToken() on the created SpeechConfig instance.

Creates an instance of SpeechConfig 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 NewSpeechConfigFromHostWithSubscription to pass the subscription key as parameter. To use an authorization token with FromHost, use this method to create a SpeechConfig instance, and then call SetAuthorizationToken() on the created SpeechConfig instance.

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

Sets proxy configuration with username and password Note: Proxy functionality is not available on macOS. This function will have no effect on this platform.

Includes word-level timestamps in response result.

Enables dictation mode. Only supported in speech continuous recognition.

Subscription key that is used to create Speech Recognizer or Intent Recognizer or Translation Recognizer or Speech Synthesizer

Region key that used to create Speech Recognizer or Intent Recognizer or Translation Recognizer or Speech Synthesizer.

Authorization token to connect to the service.

Sets the authorization token to connect to the service. 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.

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

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.