Skip to content

Commit 4b5a98c

Browse files
authored
Merge pull request #53130 from v-tawe/patch-7
Create speech recognizer
2 parents 8b7b45f + 3657bab commit 4b5a98c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

articles/cognitive-services/Speech-Service/includes/how-to/speech-to-text-basics/speech-to-text-basics-javascript.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ Reference the `AudioConfig` object as follows:
9797

9898
```javascript
9999
const audioConfig = AudioConfig.fromDefaultMicrophoneInput();
100-
const speechConfig = SpeechConfig.fromSubscription(speechConfig, audioConfig);
100+
const recognizer = new SpeechRecognizer(speechConfig, audioConfig);
101101
```
102102

103103
If you want to provide an audio file instead of using a microphone, you'll still need to provide an `audioConfig`. However, this can only be done when targeting **Node.js** and when you create an [`AudioConfig`](https://docs.microsoft.com/javascript/api/microsoft-cognitiveservices-speech-sdk/audioconfig?view=azure-node-latest), instead of calling `fromDefaultMicrophoneInput`, you'll call `fromWavFileOutput` and pass the `filename` parameter.
104104

105105
```javascript
106106
const audioConfig = AudioConfig.fromWavFileInput("YourAudioFile.wav");
107-
const speechConfig = SpeechConfig.fromSubscription(speechConfig, audioConfig);
107+
const recognizer = new SpeechRecognizer(speechConfig, audioConfig);
108108
```
109109

110110
## Recognize speech
@@ -262,4 +262,4 @@ phraseList.clear();
262262
Phrase lists are only one option to improve recognition accuracy. You can also:
263263

264264
* [Improve accuracy with Custom Speech](../../../how-to-custom-speech.md)
265-
* [Improve accuracy with tenant models](../../../tutorial-tenant-model.md)
265+
* [Improve accuracy with tenant models](../../../tutorial-tenant-model.md)

0 commit comments

Comments
 (0)