Skip to content

Commit 53e5193

Browse files
Merge pull request #284398 from solarrezaei11/solarworkingbranch
Add link to Python GitHub code and reference to Transcriptions_Create examples.
2 parents dcdb3e9 + 0ff43c0 commit 53e5193

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

articles/ai-services/speech-service/batch-transcription-create.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ You can query the status of your transcriptions with the [Transcriptions_Get](/r
108108
Call [Transcriptions_Delete](/rest/api/speechtotext/transcriptions/delete)
109109
regularly from the service, after you retrieve the results. Alternatively, set the `timeToLive` property to ensure the eventual deletion of the results.
110110

111+
> [!TIP]
112+
> You can also try the Batch Transcription API using Python on [GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/batch/python/python-client/main.py).
113+
114+
111115
::: zone-end
112116

113117
::: zone pivot="speech-cli"
@@ -168,7 +172,7 @@ spx help batch transcription
168172

169173
::: zone pivot="rest-api"
170174

171-
Here are some property options that you can use to configure a transcription when you call the [Transcriptions_Create](/rest/api/speechtotext/transcriptions/create) operation.
175+
Here are some property options to configure a transcription when you call the [Transcriptions_Create](/rest/api/speechtotext/transcriptions/create) operation. You can find more examples on the same page, such as [creating a transcription with language identification](/rest/api/speechtotext/transcriptions/create/#create-a-transcription-with-language-identification).
172176

173177
| Property | Description |
174178
|----------|-------------|

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ The voice that speaks is determined in order of priority as follows:
3636
- If both `SpeechSynthesisVoiceName` and `SpeechSynthesisLanguage` are set, the `SpeechSynthesisLanguage` setting is ignored. The voice that you specify by using `SpeechSynthesisVoiceName` speaks.
3737
- If the voice element is set by using [Speech Synthesis Markup Language (SSML)](../../../speech-synthesis-markup.md), the `SpeechSynthesisVoiceName` and `SpeechSynthesisLanguage` settings are ignored.
3838

39+
In summary, the order of priority can be described as:
40+
41+
| `SpeechSynthesisVoiceName` | `SpeechSynthesisLanguage` | SSML | Outcome |
42+
|:----------------------------:|:----------------------------:|:--------:|---------------------------------------------------------|
43+
|||| Default voice for `en-US` speaks |
44+
|||| Default voice for specified locale speaks. |
45+
|||| The voice that you specify by using `SpeechSynthesisVoiceName` speaks. |
46+
|||| The voice that you specify by using SSML speaks. |
47+
3948
## Synthesize speech to a file
4049

4150
Create a [SpeechSynthesizer](/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechsynthesizer) object. This object runs text to speech conversions and outputs to speakers, files, or other output streams. `SpeechSynthesizer` accepts as parameters:
@@ -53,7 +62,8 @@ Create a [SpeechSynthesizer](/python/api/azure-cognitiveservices-speech/azure.co
5362

5463
```python
5564
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
56-
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+
5767
```
5868

5969
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.
@@ -85,8 +95,8 @@ In this example, use the `AudioDataStream` constructor to get a stream from the
8595

8696
```python
8797
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None)
88-
result = speech_synthesizer.speak_text_async("I'm excited to try text to speech").get()
89-
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)
90100
```
91101

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

115-
result = speech_synthesizer.speak_text_async("I'm excited to try text to speech").get()
116-
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)
117127
stream.save_to_wav_file("path/to/write/file.wav")
118128
```
119129

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

148158
ssml_string = open("ssml.xml", "r").read()
149-
result = speech_synthesizer.speak_ssml_async(ssml_string).get()
159+
speech_synthesis_result = speech_synthesizer.speak_ssml_async(ssml_string).get()
150160

151-
stream = speechsdk.AudioDataStream(result)
161+
stream = speechsdk.AudioDataStream(speech_synthesis_result)
152162
stream.save_to_wav_file("path/to/write/file.wav")
153163
```
154164

0 commit comments

Comments
 (0)