Skip to content

Commit 5aa5692

Browse files
committed
Minor tweaks
1 parent d852559 commit 5aa5692

File tree

1 file changed

+7
-10
lines changed
  • articles/cognitive-services/Speech-Service/includes/quickstarts/from-file/python

1 file changed

+7
-10
lines changed

articles/cognitive-services/Speech-Service/includes/quickstarts/from-file/python/python.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: nitinme
77
ms.service: cognitive-services
88
ms.subservice: speech-service
99
ms.topic: include
10-
ms.date: 12/17/2019
10+
ms.date: 01/14/2020
1111
ms.author: chlandsi
1212
---
1313

@@ -16,7 +16,7 @@ ms.author: chlandsi
1616
Before you get started, make sure to:
1717

1818
> [!div class="checklist"]
19-
> * [Create an Azure Speech Resource](../../../../get-started.md)
19+
> * [Create an Azure Speech resource](../../../../get-started.md)
2020
> * [Create a LUIS application and get an endpoint key](../../../../quickstarts/create-luis.md)
2121
> * [Setup your development environment](../../../../quickstarts/setup-platform.md)
2222
> * [Create an empty sample project](../../../../quickstarts/create-project.md)
@@ -48,8 +48,7 @@ Or you can download this quickstart tutorial as a [Jupyter](https://jupyter.org)
4848
> [!NOTE]
4949
> The Speech SDK will default to recognizing using en-us for the language, see [Specify source language for speech to text](../../../../how-to-specify-source-language.md) for information on choosing the source language.
5050
51-
````Python
52-
51+
```python
5352
import azure.cognitiveservices.speech as speechsdk
5453

5554
# Creates an instance of a speech config with specified subscription key and service region.
@@ -67,7 +66,6 @@ speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audi
6766

6867
print("Recognizing first result...")
6968

70-
7169
# Starts speech recognition, and returns after a single utterance is recognized. The end of a
7270
# single utterance is determined by listening for silence at the end or until a maximum of 15
7371
# seconds of audio is processed. The task returns the recognition text as result.
@@ -86,8 +84,7 @@ elif result.reason == speechsdk.ResultReason.Canceled:
8684
print("Speech Recognition canceled: {}".format(cancellation_details.reason))
8785
if cancellation_details.reason == speechsdk.CancellationReason.Error:
8886
print("Error details: {}".format(cancellation_details.error_details))
89-
90-
````
87+
```
9188

9289
### Install and use the Speech SDK with Visual Studio Code
9390

@@ -109,14 +106,14 @@ elif result.reason == speechsdk.ResultReason.Canceled:
109106
1. Copy, paste, and save the [Python code](#sample-code) to the newly created file.
110107
1. Insert your Speech service subscription information.
111108
1. If selected, a Python interpreter displays on the left side of the status bar at the bottom of the window.
112-
Otherwise, bring up a list of available Python interpreters. Open the command palette (Ctrl+Shift+P) and enter **Python: Select Interpreter**. Choose an appropriate one.
109+
Otherwise, bring up a list of available Python interpreters. Open the command palette <kbd>Ctrl+Shift+P</kbd> and enter **Python: Select Interpreter**. Choose an appropriate one.
113110
1. You can install the Speech SDK Python package from within Visual Studio Code. Do that if it's not installed yet for the Python interpreter you selected.
114-
To install the Speech SDK package, open a terminal. Bring up the command palette again (Ctrl+Shift+P) and enter **Terminal: Create New Integrated Terminal**.
111+
To install the Speech SDK package, open a terminal. Bring up the command palette again <kbd>Ctrl+Shift+P</kbd> and enter **Terminal: Create New Integrated Terminal**.
115112
In the terminal that opens, enter the command `python -m pip install azure-cognitiveservices-speech` or the appropriate command for your system.
116113
1. To run the sample code, right-click somewhere inside the editor. Select **Run Python File in Terminal**.
117114
The first 15 seconds of speech input from your audio file will be recognized and logged in the console window.
118115

119-
```text
116+
```console
120117
Recognizing first result...
121118
We recognized: What's the weather like?
122119
```

0 commit comments

Comments
 (0)