Skip to content

Commit d9c0ca2

Browse files
committed
Change variable names to match Quickstart code
1 parent f34f3fb commit d9c0ca2

File tree

1 file changed

+8
-7
lines changed
  • articles/ai-services/speech-service/includes/how-to/speech-synthesis

1 file changed

+8
-7
lines changed

articles/ai-services/speech-service/includes/how-to/speech-synthesis/python.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ Create a [SpeechSynthesizer](/python/api/azure-cognitiveservices-speech/azure.co
6262

6363
```python
6464
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
65-
speech_synthesizer.speak_text_async("I'm excited to try text to speech")
65+
speech_synthesis_result = speech_synthesizer.speak_text_async("I'm excited to try text to speech").get()
66+
6667
```
6768

6869
When you run the program, it creates a synthesized *.wav* file, which is written to the location that you specify. This result is a good example of the most basic usage. Next, you can customize output and handle the output response as an in-memory stream for working with custom scenarios.
@@ -94,8 +95,8 @@ In this example, use the `AudioDataStream` constructor to get a stream from the
9495

9596
```python
9697
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None)
97-
result = speech_synthesizer.speak_text_async("I'm excited to try text to speech").get()
98-
stream = speechsdk.AudioDataStream(result)
98+
speech_synthesis_result = speech_synthesizer.speak_text_async("I'm excited to try text to speech").get()
99+
stream = speechsdk.AudioDataStream(speech_synthesis_result)
99100
```
100101

101102
At this point, you can implement any custom behavior by using the resulting `stream` object.
@@ -121,8 +122,8 @@ This example specifies the high-fidelity RIFF format `Riff24Khz16BitMonoPcm` by
121122
speech_config.set_speech_synthesis_output_format(speechsdk.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm)
122123
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None)
123124

124-
result = speech_synthesizer.speak_text_async("I'm excited to try text to speech").get()
125-
stream = speechsdk.AudioDataStream(result)
125+
speech_synthesis_result = speech_synthesizer.speak_text_async("I'm excited to try text to speech").get()
126+
stream = speechsdk.AudioDataStream(speech_synthesis_result)
126127
stream.save_to_wav_file("path/to/write/file.wav")
127128
```
128129

@@ -155,9 +156,9 @@ To start using SSML for customization, make a minor change that switches the voi
155156
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None)
156157

157158
ssml_string = open("ssml.xml", "r").read()
158-
result = speech_synthesizer.speak_ssml_async(ssml_string).get()
159+
speech_synthesis_result = speech_synthesizer.speak_ssml_async(ssml_string).get()
159160

160-
stream = speechsdk.AudioDataStream(result)
161+
stream = speechsdk.AudioDataStream(speech_synthesis_result)
161162
stream.save_to_wav_file("path/to/write/file.wav")
162163
```
163164

0 commit comments

Comments
 (0)