Skip to content

Commit 36bcb46

Browse files
Merge pull request #218243 from eric-urban/eur/qs-updates
fix Python QS samples
2 parents 4411609 + 4761d34 commit 36bcb46

File tree

3 files changed

+5
-4
lines changed
  • articles/cognitive-services/Speech-Service/includes/quickstarts

3 files changed

+5
-4
lines changed

articles/cognitive-services/Speech-Service/includes/quickstarts/speech-to-text-basics/python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Install a version of [Python from 3.7 to 3.10](https://www.python.org/downloads/
3636

3737
Follow these steps to create a new console application.
3838

39-
1. Open a command prompt where you want the new project, and create a new file named `speech-recognition.py`.
39+
1. Open a command prompt where you want the new project, and create a new file named `speech_recognition.py`.
4040
1. Run this command to install the Speech SDK:
4141
```console
4242
pip install azure-cognitiveservices-speech

articles/cognitive-services/Speech-Service/includes/quickstarts/speech-translation-basics/python.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@ Install a version of [Python from 3.7 to 3.10](https://www.python.org/downloads/
3030

3131
Follow these steps to create a new console application.
3232

33-
1. Open a command prompt where you want the new project, and create a new file named `speech-recognition.py`.
33+
1. Open a command prompt where you want the new project, and create a new file named `speech_translation.py`.
3434
1. Run this command to install the Speech SDK:
3535
```console
3636
pip install azure-cognitiveservices-speech
3737
```
3838
1. Copy the following code into `speech_translation.py`:
3939

4040
```Python
41+
import os
4142
import azure.cognitiveservices.speech as speechsdk
4243
4344
def recognize_from_microphone():
4445
# This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
45-
speech_translation_config = speechsdk.SpeechTranslationConfig(subscription=os.environ.get('SPEECH_KEY'), region=os.environ.get('SPEECH_REGION'))
46+
speech_translation_config = speechsdk.translation.SpeechTranslationConfig(subscription=os.environ.get('SPEECH_KEY'), region=os.environ.get('SPEECH_REGION'))
4647
speech_translation_config.speech_recognition_language="en-US"
4748
4849
target_language="it"

articles/cognitive-services/Speech-Service/includes/quickstarts/text-to-speech-basics/python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Install a version of [Python from 3.7 to 3.10](https://www.python.org/downloads/
3636

3737
Follow these steps to create a new console application.
3838

39-
1. Open a command prompt where you want the new project, and create a new file named `speech-synthesis.py`.
39+
1. Open a command prompt where you want the new project, and create a new file named `speech_synthesis.py`.
4040
1. Run this command to install the Speech SDK:
4141
```console
4242
pip install azure-cognitiveservices-speech

0 commit comments

Comments
 (0)