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/
36
36
37
37
Follow these steps to create a new console application.
38
38
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` .
40
40
1 . Run this command to install the Speech SDK:
41
41
``` console
42
42
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/
30
30
31
31
Follow these steps to create a new console application.
32
32
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` .
34
34
1 . Run this command to install the Speech SDK:
35
35
``` console
36
36
pip install azure-cognitiveservices-speech
37
37
```
38
38
1. Copy the following code into `speech_translation.py`:
39
39
40
40
```Python
41
+ import os
41
42
import azure.cognitiveservices.speech as speechsdk
42
43
43
44
def recognize_from_microphone():
44
45
# 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'))
46
47
speech_translation_config.speech_recognition_language="en-US"
47
48
48
49
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/
36
36
37
37
Follow these steps to create a new console application.
38
38
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` .
40
40
1 . Run this command to install the Speech SDK:
41
41
``` console
42
42
pip install azure-cognitiveservices-speech
You can’t perform that action at this time.
0 commit comments