Skip to content

Commit c3af6de

Browse files
authored
Update csharp.md with Live Interpreter sample code
Update csharp.md with Live Interpreter sample code
1 parent 0a3ea02 commit c3af6de

File tree

1 file changed

+31
-0
lines changed
  • articles/ai-services/speech-service/includes/how-to/translate-speech

1 file changed

+31
-0
lines changed

articles/ai-services/speech-service/includes/how-to/translate-speech/csharp.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,37 @@ var translationRecognizer = new TranslationRecognizer(speechTranslationConfig, a
407407

408408
For a complete code sample with the Speech SDK, see [speech translation samples on GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/csharp/sharedcontent/console/translation_samples.cs#L714).
409409

410+
## Using live interpreter (Public Preview) for realtime speech-to-speech translation with personal voice
411+
412+
Live Interpreter continuously identifies the language being spoken without requiring you to set an input language and delivers low latency speech-to-speech translation in a natural voice that preserves the speaker’s style and tone.
413+
414+
To use the live interpreter API, please first apply for personal voice access [here](https://aka.ms/customneural) and select "Personal Voice" for Question 20. For resource ID, please make sure that it is in one of the following regions supported by the Public Preview:
415+
- West US 2
416+
- East US
417+
- Sewden Central
418+
- West Europe
419+
- Southeast Asia
420+
- Japan East
421+
422+
After the granting of personal voice access permission, you can enable live interpreter with the following code:
423+
424+
```csharp
425+
// Please replace the service region with your region
426+
var v2EndpointInString = String.Format("wss://{0}.stt.speech.microsoft.com/speech/universal/v2", "YourRegion");
427+
var v2EndpointUrl = new Uri(v2EndpointInString);
428+
429+
// Creates an instance of a speech translation config with specified subscription key and service region.
430+
// Please replace the service subscription key with your subscription key
431+
var config = SpeechTranslationConfig.FromEndpoint(v2EndpointUrl, "YourSubscriptionKey");
432+
433+
// Translation target language and enable personal voice
434+
config.AddTargetLanguage("fr");
435+
config.VoiceName("personal-voice");
436+
437+
// You don't need to define any candidate languages to detect.
438+
var autoDetectSourceLanguageConfig = AutoDetectSourceLanguageConfig.FromOpenRange();
439+
```
440+
410441
## Using custom translation in speech translation
411442
The custom translation feature in speech translation seamlessly integrates with the Azure Custom Translation service, allowing you to achieve more accurate and tailored translations. As the integration directly harnesses the capabilities of the Azure custom translation service, you need to use a multi-service resource to ensure the correct functioning of the complete set of features. For detailed instructions, please consult the guide on [Create a multi-service resource for Azure AI services](/azure/ai-services/multi-service-resource?tabs=windows&pivots=azportal).
412443

0 commit comments

Comments
 (0)