Skip to content

Commit e335a6b

Browse files
committed
Updates based on feedback
1 parent 396d77f commit e335a6b

File tree

4 files changed

+20
-30
lines changed

4 files changed

+20
-30
lines changed

articles/cognitive-services/Speech-Service/includes/how-to/speech-to-text-basics/speech-to-text-basics-cpp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ auto config = SpeechConfig::FromSubscription("YourSubscriptionKey", "YourService
4040

4141
## Initialize a recognizer
4242

43-
After you've created a [`SpeechConfig`](https://docs.microsoft.com/cpp/cognitive-services/speech/speechconfig), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/cpp/cognitive-services/speech/speechrecognizer). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/cpp/cognitive-services/speech/speechrecognizer), you'll need to pass it your `speech_config`. This ensures that the credentials that the service requires to validate your request are provided.
43+
After you've created a [`SpeechConfig`](https://docs.microsoft.com/cpp/cognitive-services/speech/speechconfig), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/cpp/cognitive-services/speech/speechrecognizer). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/cpp/cognitive-services/speech/speechrecognizer), you'll need to pass it your `speech_config`. This provides the credentials that the speech service requires to validate your request.
4444

4545
If you're recognizing speech using your device's default microphone, here's what the [`SpeechRecognizer`](https://docs.microsoft.com/cpp/cognitive-services/speech/speechrecognizer) should look like:
4646

@@ -66,7 +66,7 @@ auto audioConfig = AudioConfig::FromDefaultMicrophoneInput();
6666
auto recognizer = SpeechRecognizer::FromConfig(config, audioConfig);
6767
```
6868

69-
If you don't want to use a microphone, and want to provide an audio file, you'll still need to provide an `audioConfig`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/cpp/cognitive-services/speech/audio-audioconfig), instead of calling `FromDefaultMicrophoneInput`, you'll call `FromWavFileOutput` and pass the `filename` parameter.
69+
If you want to provide an audio file instead of using a microphone, you'll still need to provide an `audioConfig`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/cpp/cognitive-services/speech/audio-audioconfig), instead of calling `FromDefaultMicrophoneInput`, you'll call `FromWavFileOutput` and pass the `filename` parameter.
7070

7171
```cpp
7272
auto audioInput = AudioConfig::FromWavFileInput("YourAudioFile.wav");
@@ -91,7 +91,7 @@ Here's an example of asynchronous single-shot recognition using [`RecognizeOnceA
9191
auto result = recognizer->RecognizeOnceAsync().get();
9292
```
9393
94-
You'll need to write some code to handle the result. This sample does a few things with the [`result->Reason`](https://docs.microsoft.com/cpp/cognitive-services/speech/recognitionresult#reason):
94+
You'll need to write some code to handle the result. This sample evaluates the [`result->Reason`](https://docs.microsoft.com/cpp/cognitive-services/speech/recognitionresult#reason):
9595

9696
* Prints the recognition result: `ResultReason::RecognizedSpeech`
9797
* If there is no recognition match, inform the user: `ResultReason::NoMatch`

articles/cognitive-services/Speech-Service/includes/how-to/speech-to-text-basics/speech-to-text-basics-csharp.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
---
2-
title: Speech service
3-
titleSuffix: Azure Cognitive Services
4-
services: cognitive-services
52
author: IEvangelist
6-
manager: nitinme
73
ms.service: cognitive-services
8-
ms.subservice: speech-service
94
ms.topic: include
10-
ms.date: 03/06/2020
5+
ms.date: 03/11/2020
116
ms.author: dapine
127
---
138

@@ -47,7 +42,7 @@ var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourSer
4742

4843
## Initialize a recognizer
4944

50-
After you've created a [`SpeechConfig`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechconfig?view=azure-dotnet), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer?view=azure-dotnet). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer?view=azure-dotnet), you'll need to pass it your `speechConfig`. This ensures that the credentials that the service requires to validate your request are provided.
45+
After you've created a [`SpeechConfig`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechconfig?view=azure-dotnet), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer?view=azure-dotnet). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer?view=azure-dotnet), you'll need to pass it your `speechConfig`. This provides the credentials that the speech service requires to validate your request.
5146

5247
If you're recognizing speech using your device's default microphone, here's what the [`SpeechRecognizer`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer?view=azure-dotnet) should look like:
5348

@@ -73,7 +68,7 @@ using var audioConfig = AudioConfig.FromDefaultMicrophoneInput();
7368
using var recognizer = new SpeechRecognizer(speechConfig, audioConfig);
7469
```
7570

76-
If you don't want to use a microphone, and want to provide an audio file, you'll still need to provide an `audioConfig`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.audio.audioconfig?view=azure-dotnet), instead of calling `FromDefaultMicrophoneInput`, you'll call `FromWavFileOutput` and pass the `filename` parameter.
71+
If you want to provide an audio file instead of using a microphone, you'll still need to provide an `audioConfig`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.audio.audioconfig?view=azure-dotnet), instead of calling `FromDefaultMicrophoneInput`, you'll call `FromWavFileOutput` and pass the `filename` parameter.
7772

7873

7974
```csharp
@@ -86,7 +81,7 @@ using var recognizer = new SpeechRecognizer(speechConfig, audioConfig);
8681
The [Recognizer class](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer?view=azure-dotne) for the Speech SDK for C# exposes a few methods that you can use for speech recognition.
8782

8883
* Single-shot recognition (async) - Performs recognition in a non-blocking (asynchronous) mode. This will recognize a single utterance. The end of a single utterance is determined by listening for silence at the end or until a maximum of 15 seconds of audio is processed.
89-
* Continuous recognition (async) - Asynchronously initiates continuous recognition operation. The user has to connect to handle event to receive recognition results. To stop asynchronous continuous recognition, call [`StopContinuousRecognitionAsync`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer.stopcontinuousrecognitionasync?view=azure-dotnet).
84+
* Continuous recognition (async) - Asynchronously initiates continuous recognition operation. The user registers to events and handles various application state. To stop asynchronous continuous recognition, call [`StopContinuousRecognitionAsync`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer.stopcontinuousrecognitionasync?view=azure-dotnet).
9085

9186
> [!NOTE]
9287
> Learn more about how to [choose a speech recognition mode](../../../how-to-choose-recognition-mode.md).
@@ -99,7 +94,7 @@ Here's an example of asynchronous single-shot recognition using [`RecognizeOnceA
9994
var result = await recognizer.RecognizeOnceAsync();
10095
```
10196

102-
You'll need to write some code to handle the result. This sample does a few things with the [`result.Reason`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.recognitionresult.reason?view=azure-dotnet):
97+
You'll need to write some code to handle the result. This sample evaluates the [`result.Reason`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.recognitionresult.reason?view=azure-dotnet):
10398

10499
* Prints the recognition result: `ResultReason.RecognizedSpeech`
105100
* If there is no recognition match, inform the user: `ResultReason.NoMatch`
@@ -222,7 +217,7 @@ A common task for speech recognition is specifying the input (or source) languag
222217
speechConfig.SpeechRecognitionLanguage = "it-IT";
223218
```
224219

225-
The [`SpeechRecognitionLanguage`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechconfig.speechrecognitionlanguage?view=azure-dotnet) property expects a BCP-47 format string. You can provide any value in the list of supported [locales/languages](../../../language-support.md).
220+
The [`SpeechRecognitionLanguage`](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechconfig.speechrecognitionlanguage?view=azure-dotnet) property expects a language-locale format string. You can provide any value in the **Locale** column in the list of supported [locales/languages](../../../language-support.md).
226221

227222
## Improve recognition accuracy
228223

articles/cognitive-services/Speech-Service/includes/how-to/speech-to-text-basics/speech-to-text-basics-java.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
author: IEvangelist
33
ms.service: cognitive-services
44
ms.topic: include
5-
ms.date: 03/06/2020
5+
ms.date: 03/11/2020
66
ms.author: dapine
77
---
88

@@ -39,7 +39,7 @@ SpeechConfig config = SpeechConfig.fromSubscription("YourSubscriptionKey", "Your
3939

4040
## Initialize a recognizer
4141

42-
After you've created a [`SpeechConfig`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechconfig?view=azure-java-stable), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable), you'll need to pass it your `config`. This ensures that the credentials that the service requires to validate your request are provided.
42+
After you've created a [`SpeechConfig`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechconfig?view=azure-java-stable), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable), you'll need to pass it your `config`. This provides the credentials that the speech service requires to validate your request.
4343

4444
If you're recognizing speech using your device's default microphone, here's what the [`SpeechRecognizer`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable) should look like:
4545

@@ -66,7 +66,7 @@ AudioConfig audioConfig = AudioConfig.fromDefaultMicrophoneInput();
6666
SpeechRecognizer recognizer = new SpeechRecognizer(config, audioConfig);
6767
```
6868

69-
If you don't want to use a microphone, and want to provide an audio file, you'll still need to provide an `audioConfig`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.audio.audioconfig?view=azure-java-stable), instead of calling `fromDefaultMicrophoneInput`, you'll call `fromWavFileOutput` and pass the `filename` parameter.
69+
If you want to provide an audio file instead of using a microphone, you'll still need to provide an `audioConfig`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.audio.audioconfig?view=azure-java-stable), instead of calling `fromDefaultMicrophoneInput`, you'll call `fromWavFileOutput` and pass the `filename` parameter.
7070

7171
```java
7272
AudioConfig audioConfig = AudioConfig.fromWavFileInput("YourAudioFile.wav");
@@ -78,7 +78,7 @@ SpeechRecognizer recognizer = new SpeechRecognizer(config, audioConfig);
7878
The [Recognizer class](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable) for the Speech SDK for Java exposes a few methods that you can use for speech recognition.
7979

8080
* Single-shot recognition (async) - Performs recognition in a non-blocking (asynchronous) mode. This will recognize a single utterance. The end of a single utterance is determined by listening for silence at the end or until a maximum of 15 seconds of audio is processed.
81-
* Continuous recognition (async) - Asynchronously initiates continuous recognition operation. The user has to handle event to receive recognition results. To stop asynchronous continuous recognition, call [stopContinuousRecognitionAsync](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable#stopcontinuousrecognitionasync).
81+
* Continuous recognition (async) - Asynchronously initiates continuous recognition operation. If you want to provide an audio file instead of using a microphone, you'll still need to provide an. To stop asynchronous continuous recognition, call [stopContinuousRecognitionAsync](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.speechrecognizer?view=azure-java-stable#stopcontinuousrecognitionasync).
8282

8383
> [!NOTE]
8484
> Learn more about how to [choose a speech recognition mode](../../../how-to-choose-recognition-mode.md).
@@ -92,7 +92,7 @@ Future<SpeechRecognitionResult> task = recognizer.recognizeOnceAsync();
9292
SpeechRecognitionResult result = task.get();
9393
```
9494

95-
You'll need to write some code to handle the result. This sample does a few things with the [`result.getReason()`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.resultreason?view=azure-java-stable):
95+
You'll need to write some code to handle the result. This sample evaluates the [`result.getReason()`](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.resultreason?view=azure-java-stable):
9696

9797
* Prints the recognition result: `ResultReason.RecognizedSpeech`
9898
* If there is no recognition match, inform the user: `ResultReason.NoMatch`

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
---
2-
title: Speech service
3-
titleSuffix: Azure Cognitive Services
4-
services: cognitive-services
5-
author: erhopf
6-
manager: nitinme
2+
author: IEvangelist
73
ms.service: cognitive-services
8-
ms.subservice: speech-service
94
ms.topic: include
10-
ms.date: 03/03/2020
11-
ms.author: erhopf
5+
ms.date: 03/11/2020
6+
ms.author: dapine
127
---
138

149
## Prerequisites
@@ -60,7 +55,7 @@ speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_r
6055

6156
## Initialize a recognizer
6257

63-
After you've created a [`SpeechConfig`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechconfig?view=azure-python), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechrecognizer?view=azure-python). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechrecognizer?view=azure-python), you'll need to pass it your `speech_config`. This ensures that the credentials that the service requires to validate your request are provided.
58+
After you've created a [`SpeechConfig`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechconfig?view=azure-python), the next step is to initialize a [`SpeechRecognizer`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechrecognizer?view=azure-python). When you initialize a [`SpeechRecognizer`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechrecognizer?view=azure-python), you'll need to pass it your `speech_config`. This provides the credentials that the speech service requires to validate your request.
6459

6560
If you're recognizing speech using your device's default microphone, here's what the [`SpeechRecognizer`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechrecognizer?view=azure-python) should look like:
6661

@@ -78,7 +73,7 @@ audio_config = AudioConfig(device_name="<device id>");
7873
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
7974
```
8075

81-
If you don't want to use a microphone, and want to provide an audio file, you'll still need to provide an `audio_config`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.audio.audioconfig?view=azure-python), instead of providing the `device_name`, you'll use the `filename` parameter.
76+
If you want to provide an audio file instead of using a microphone, you'll still need to provide an `audio_config`. However, when you create an [`AudioConfig`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.audio.audioconfig?view=azure-python), instead of providing the `device_name`, you'll use the `filename` parameter.
8277

8378
```Python
8479
audio_filename = "whatstheweatherlike.wav"
@@ -112,7 +107,7 @@ Here's an example of synchronous single-shot recognition using [`recognize_once_
112107
result = speech_recognizer.recognize_once_async()
113108
```
114109

115-
Regardless of whether you've used the synchronous or asynchronous method, you'll need to write some code to iterate through the result. This sample does a few things with the [`result.reason`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.resultreason?view=azure-python):
110+
Regardless of whether you've used the synchronous or asynchronous method, you'll need to write some code to iterate through the result. This sample evaluates the [`result.reason`](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.resultreason?view=azure-python):
116111

117112
* Prints the recognition result: `speechsdk.ResultReason.RecognizedSpeech`
118113
* If there is no recognition match, inform the user: `speechsdk.ResultReason.NoMatch `

0 commit comments

Comments
 (0)