Skip to content

Commit 7a87555

Browse files
authored
Merge pull request #185188 from eric-urban/patch-2
Update text-to-speech-basics-javascript.md
2 parents 76ec6fd + 4a28b2d commit 7a87555

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
author: eric-urban
33
ms.service: cognitive-services
44
ms.topic: include
5-
ms.date: 07/02/2021
5+
ms.date: 01/15/2022
66
ms.author: eur
77
ms.custom: devx-track-js
88
---
@@ -135,10 +135,10 @@ For many scenarios in speech application development, you likely need the result
135135
* Integrate the result with other API's or services.
136136
* Modify the audio data, write custom `.wav` headers, etc.
137137

138-
It's simple to make this change from the previous example. First, remove the `AudioConfig` block, as you will manage the output behavior manually from this point onward for increased control. Then pass `undefined` for the `AudioConfig` in the `SpeechSynthesizer` constructor.
138+
It's simple to make this change from the previous example. First, remove the `AudioConfig` block, as you will manage the output behavior manually from this point onward for increased control. Then pass `null` for the `AudioConfig` in the `SpeechSynthesizer` constructor.
139139

140140
> [!NOTE]
141-
> Passing `undefined` for the `AudioConfig`, rather than omitting it like in the speaker output example above, will not play the audio by default on the current active output device.
141+
> Passing `null` for the `AudioConfig`, rather than omitting it like in the speaker output example above, will not play the audio by default on the current active output device.
142142
143143
This time, you save the result to a [`SpeechSynthesisResult`](/javascript/api/microsoft-cognitiveservices-speech-sdk/speechsynthesisresult) variable. The `SpeechSynthesisResult.audioData` property returns an `ArrayBuffer` of the output data, the default browser stream type. For server-code, convert the arrayBuffer to a buffer stream.
144144

@@ -212,7 +212,7 @@ function synthesizeSpeech() {
212212
// Set the output format
213213
speechConfig.speechSynthesisOutputFormat = SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm;
214214

215-
const synthesizer = new sdk.SpeechSynthesizer(speechConfig, undefined);
215+
const synthesizer = new sdk.SpeechSynthesizer(speechConfig, null);
216216
synthesizer.speakTextAsync(
217217
"Customizing audio output format.",
218218
result => {
@@ -258,7 +258,7 @@ For more information on `readFileSync`, see <a href="https://nodejs.org/api/fs.h
258258
```javascript
259259
function synthesizeSpeech() {
260260
const speechConfig = sdk.SpeechConfig.fromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
261-
const synthesizer = new sdk.SpeechSynthesizer(speechConfig, undefined);
261+
const synthesizer = new sdk.SpeechSynthesizer(speechConfig, null);
262262

263263
const ssml = xmlToString("ssml.xml");
264264
synthesizer.speakSsmlAsync(

0 commit comments

Comments
 (0)