File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
articles/cognitive-services/Speech-Service/includes/quickstarts
speech-translation-basics Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ Install a version of [Python from 3.7 to 3.10](https://www.python.org/downloads/
3636
3737Follow 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` .
40401 . Run this command to install the Speech SDK:
4141 ``` console
4242 pip install azure-cognitiveservices-speech
Original file line number Diff line number Diff line change @@ -30,19 +30,20 @@ Install a version of [Python from 3.7 to 3.10](https://www.python.org/downloads/
3030
3131Follow 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` .
34341 . Run this command to install the Speech SDK:
3535 ``` console
3636 pip install azure-cognitiveservices-speech
3737 ```
38381. 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"
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ Install a version of [Python from 3.7 to 3.10](https://www.python.org/downloads/
3636
3737Follow 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` .
40401 . Run this command to install the Speech SDK:
4141 ``` console
4242 pip install azure-cognitiveservices-speech
You can’t perform that action at this time.
0 commit comments