Condividi tramite


SpeechConfig.FromEndpoint Method

Definition

Overloads

FromEndpoint(Uri)

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

FromEndpoint(Uri, TokenCredential)

Creates a speech configuration instance using a specified endpoint and AAD token credential. Introduced in version 1.43.0.

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

public static Microsoft.CognitiveServices.Speech.SpeechConfig FromEndpoint(Uri endpoint);
static member FromEndpoint : Uri -> Microsoft.CognitiveServices.Speech.SpeechConfig
Public Shared Function FromEndpoint (endpoint As Uri) As SpeechConfig

Parameters

endpoint
Uri

The service endpoint to connect to.

Returns

A speech config instance.

Remarks

* This method is only used for a non-standard resource path or parameter overrides. To change the host name with standard resource paths, use **FromHost** instead. * The query parameters specified in the endpoint URI are not changed, even if they are set by any other APIs. Note that whether a specific query parameter is supported or not, depends on the endpoint and scenario. 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". The example only applies when the endpoint and scenario combination supports language as a query parameter. Only the parameters that are not specified in the endpoint URI can be set by other APIs. * 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.

Applies to

FromEndpoint(Uri, TokenCredential)

Creates a speech configuration instance using a specified endpoint and AAD token credential. Introduced in version 1.43.0.

public static Microsoft.CognitiveServices.Speech.SpeechConfig FromEndpoint(Uri endpoint, Azure.Core.TokenCredential credential);
static member FromEndpoint : Uri * Azure.Core.TokenCredential -> Microsoft.CognitiveServices.Speech.SpeechConfig
Public Shared Function FromEndpoint (endpoint As Uri, credential As TokenCredential) As SpeechConfig

Parameters

endpoint
Uri

The service endpoint with a custom domain. For more details, visit: Microsoft Docs.

credential
TokenCredential

The AAD token credential used for authentication and token requests.

Returns

A configured instance of SpeechConfig.

Remarks

* The AAD token is automatically refreshed before expiration. * This API is available for **SpeechRecognizer, ConversationTranscriber, TranslationRecognizer, and SourceLanguageRecognizer**. * This method is intended for scenarios requiring a **non-standard resource path** or **custom parameter overrides**. For standard resource paths, use **FromHost** instead to modify the hostname. * Query parameters specified in the **endpoint URI remain unchanged**, even if modified through other APIs. The availability and support of specific query parameters depend on the **endpoint and scenario**. For example, if the URI contains the query parameter `"language=de-DE"`, but the property `SpeechRecognitionLanguage` is set to `"en-US"`, the URI setting takes precedence, and `"de-DE"` will be used as the recognition language. This behavior applies only when the **endpoint and scenario combination supports language as a query parameter**. Parameters **not defined in the URI** can be modified via other APIs. * If the endpoint requires authentication using a **subscription key**, use `FromEndpoint(System.Uri, string)` to pass the key as a parameter. To authenticate with an **authorization token**, use `FromEndpoint(System.Uri)`, then set the `AuthorizationToken` property on the newly created `SpeechConfig` instance.

Applies to

FromEndpoint(Uri, String)

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

public static Microsoft.CognitiveServices.Speech.SpeechConfig FromEndpoint(Uri endpoint, string subscriptionKey);
static member FromEndpoint : Uri * string -> Microsoft.CognitiveServices.Speech.SpeechConfig
Public Shared Function FromEndpoint (endpoint As Uri, subscriptionKey As String) As SpeechConfig

Parameters

endpoint
Uri

The service endpoint to connect to.

subscriptionKey
String

The subscription key. To create or find your key and region, see Find keys and region.

Returns

A speech config instance.

Remarks

* This method is only used for a non-standard resource path or parameter overrides. To change the host name with standard resource paths, use **FromHost** instead. * The query parameters specified in the endpoint URI are not changed, even if they are set by any other API call. For example, if the recognition language is defined in the URI query parameter as "language=de-DE", and the property SpeechRecognitionLanguage is set to "en-US", the language set in the URI takes precedence, and "de-DE" remains the expected language. Since parameters included in the endpoint URI take priority, only parameters that are not specified in the endpoint URI can be set by other APIs. * To use an authorization token with FromEndpoint, use FromEndpoint(System.Uri), and then set the AuthorizationToken property on the new SpeechConfig instance.

Applies to