Skip to content

Commit 9191ef5

Browse files
author
Qi Ding
committed
apply FromsEnpoint api in speech to text basics c#sample code as first try
1 parent 301b098 commit 9191ef5

File tree

1 file changed

+4
-4
lines changed
  • articles/ai-services/speech-service/includes/quickstarts/speech-to-text-basics

1 file changed

+4
-4
lines changed

articles/ai-services/speech-service/includes/quickstarts/speech-to-text-basics/csharp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Follow these steps to create a console application and install the Speech SDK.
5454

5555
class Program
5656
{
57-
// This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
57+
// This example requires environment variables named "SPEECH_KEY" and "END_POINT"
5858
static string speechKey = Environment.GetEnvironmentVariable("SPEECH_KEY");
59-
static string speechRegion = Environment.GetEnvironmentVariable("SPEECH_REGION");
59+
static string endPoint = Environment.GetEnvironmentVariable("END_POINT");
6060

6161
static void OutputSpeechRecognitionResult(SpeechRecognitionResult speechRecognitionResult)
6262
{
@@ -84,7 +84,7 @@ Follow these steps to create a console application and install the Speech SDK.
8484

8585
async static Task Main(string[] args)
8686
{
87-
var speechConfig = SpeechConfig.FromSubscription(speechKey, speechRegion);
87+
var speechConfig = SpeechConfig.FromEndpoint(speechKey, endPoint);
8888
speechConfig.SpeechRecognitionLanguage = "en-US";
8989

9090
using var audioConfig = AudioConfig.FromDefaultMicrophoneInput();
@@ -106,7 +106,7 @@ Follow these steps to create a console application and install the Speech SDK.
106106
```
107107

108108
> [!IMPORTANT]
109-
> Make sure that you set the `SPEECH_KEY` and `SPEECH_REGION` [environment variables](#set-environment-variables). If you don't set these variables, the sample fails with an error message.
109+
> Make sure that you set the `SPEECH_KEY` and `END_POINT` [environment variables](#set-environment-variables). If you don't set these variables, the sample fails with an error message.
110110
111111
1. Speak into your microphone when prompted. What you speak should appear as text:
112112

0 commit comments

Comments
 (0)