Skip to content

Commit 0fc9e71

Browse files
author
Xiting Zhang
committed
update
1 parent 3f854de commit 0fc9e71

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

articles/ai-services/speech-service/how-to-configure-azure-ad-auth.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,20 @@ var endpoint = "wss://{your custom name}.cognitiveservices.azure.com/stt/speech/
190190
var speechConfig = SpeechConfig.FromEndpoint(new Uri(endpoint), browserCredential);
191191
```
192192

193+
### TranslationRecognizer
194+
195+
For ```TranslationRecognizer``` object, use an appropriate instance of [TokenCredential](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential) for authentication, along with the endpoint that includes your [custom domain](https://learn.microsoft.com/azure/ai-services/speech-service/speech-services-private-link?tabs=portal#create-a-custom-domain-name), to create a ```SpeechTranslationConfig``` object.
196+
197+
```C#
198+
TokenCredential browserCredential = new InteractiveBrowserCredential();
199+
200+
// Define the custom domain endpoint for your Speech resource
201+
var endpoint = "wss://{your custom name}.cognitiveservices.azure.com/stt/speech/universal/v2";
202+
203+
// Create the SpeechTranslationConfig object using the custom domain endpoint and TokenCredential.
204+
var speechConfig = SpeechTranslationConfig.FromEndpoint(new Uri(endpoint), browserCredential);
205+
```
206+
193207
### SpeechSynthesizer, IntentRecognizer
194208

195209
For ```SpeechSynthesizer```, ```IntentRecognizer``` objects, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechConfig``` object.
@@ -250,23 +264,9 @@ speechConfig = SpeechConfig(auth_token=authorizationToken, region=region)
250264
```
251265
::: zone-end
252266

267+
::: zone pivot="programming-language-cpp"
253268
### TranslationRecognizer
254269

255-
::: zone pivot="programming-language-csharp"
256-
For ```TranslationRecognizer``` object, use an appropriate instance of [TokenCredential](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential) for authentication, along with the endpoint that includes your [custom domain](https://learn.microsoft.com/azure/ai-services/speech-service/speech-services-private-link?tabs=portal#create-a-custom-domain-name), to create a ```SpeechTranslationConfig``` object.
257-
258-
```C#
259-
TokenCredential browserCredential = new InteractiveBrowserCredential();
260-
261-
// Define the custom domain endpoint for your Speech resource
262-
var endpoint = "wss://{your custom name}.cognitiveservices.azure.com/stt/speech/universal/v2";
263-
264-
// Create the SpeechTranslationConfig object using the custom domain endpoint and TokenCredential.
265-
var speechConfig = SpeechTranslationConfig.FromEndpoint(new Uri(endpoint), browserCredential);
266-
```
267-
::: zone-end
268-
269-
::: zone pivot="programming-language-cpp"
270270
For the ```TranslationRecognizer```, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechTranslationConfig``` object.
271271

272272
```cpp
@@ -281,6 +281,8 @@ auto speechConfig = SpeechTranslationConfig::FromAuthorizationToken(authorizatio
281281
::: zone-end
282282

283283
::: zone pivot="programming-language-java"
284+
### TranslationRecognizer
285+
284286
For the ```TranslationRecognizer```, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechTranslationConfig``` object.
285287

286288
```Java
@@ -294,6 +296,8 @@ SpeechTranslationConfig translationConfig = SpeechTranslationConfig.fromAuthoriz
294296
::: zone-end
295297

296298
::: zone pivot="programming-language-python"
299+
### TranslationRecognizer
300+
297301
For the ```TranslationRecognizer```, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechTranslationConfig``` object.
298302

299303
```Python

0 commit comments

Comments
 (0)