共用方式為


SpeechTranslationConfig.FromHost Method

Definition

Overloads

FromHost(Uri)

Creates an instance of the speech translation config with specified host. Added in 1.8.0

FromHost(Uri, String)

Creates an instance of the speech translation config with specified host and subscription key. Added in 1.8.0

FromHost(Uri)

Creates an instance of the speech translation config with specified host. Added in 1.8.0

public static Microsoft.CognitiveServices.Speech.SpeechTranslationConfig FromHost (Uri host);
static member FromHost : Uri -> Microsoft.CognitiveServices.Speech.SpeechTranslationConfig
Public Shared Function FromHost (host As Uri) As SpeechTranslationConfig

Parameters

host
Uri

The service host to connect to. Format is protocol://host:port where :port is optional.

Returns

A SpeechTranslationConfig instance.

Remarks

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.

To use an authorization token with **FromHost**, use this method to create a **SpeechTranslationConfig** instance, and then set the **AuthorizationToken** property on the created **SpeechTranslationConfig** instance.

Notes: * Query parameters are not allowed in the host URI and must be set by other APIs. * If the host requires a subscription key for authentication, use **FromHost(System.Uri, string)** to pass the subscription key as parameter.

Applies to

FromHost(Uri, String)

Creates an instance of the speech translation config with specified host and subscription key. Added in 1.8.0

public static Microsoft.CognitiveServices.Speech.SpeechTranslationConfig FromHost (Uri host, string subscriptionKey);
static member FromHost : Uri * string -> Microsoft.CognitiveServices.Speech.SpeechTranslationConfig
Public Shared Function FromHost (host As Uri, subscriptionKey As String) As SpeechTranslationConfig

Parameters

host
Uri

The service host to connect to. Format is "protocol://host:port" where ":port" is optional.

subscriptionKey
String

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

Returns

A SpeechTranslationConfig instance.

Remarks

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. Notes: * Query parameters are not allowed in the host URI and must be set by other APIs. * To use an authorization token with **FromHost**, use **FromHost(System.Uri)**, and then set the **AuthorizationToken** property on the created **SpeechTranslationConfig** instance.

Applies to