You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/how-to-choose-recognition-mode.md
+41-15Lines changed: 41 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ ms.subservice: speech-service
10
10
ms.topic: conceptual
11
11
ms.date: 01/10/2020
12
12
ms.author: dapine
13
+
zone_pivot_groups: programming-languages-set-two
13
14
---
14
15
15
16
# Choosing a speech recognition mode
@@ -22,45 +23,53 @@ If you want to process each utterance one "sentence" at a time, use the "recogni
22
23
23
24
At the end of one recognized utterance, the service stops processing audio from that request. The maximum limit for recognition is a sentence duration of 20 seconds.
24
25
25
-
# [C#](#tab/csharp)
26
+
::: zone pivot="programming-language-csharp"
26
27
27
28
For more information on using the `RecognizeOnceAsync` function, see the [.NET Speech SDK docs](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechrecognizer.recognizeonceasync?view=azure-dotnet#Microsoft_CognitiveServices_Speech_SpeechRecognizer_RecognizeOnceAsync).
For more information on using the `RecognizeOnceAsync` function, see the [C++ Speech SDK docs](https://docs.microsoft.com/cpp/cognitive-services/speech/asyncrecognizer#recognizeonceasync).
36
38
37
39
```cpp
38
40
auto result = recognize->RecognizeOnceAsync().get();
39
41
```
40
42
41
-
# [Java](#tab/java)
43
+
::: zone-end
44
+
::: zone pivot="programming-language-java"
42
45
43
46
For more information on using the `recognizeOnceAsync` function, see the [Java Speech SDK docs](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.SpeechRecognizer.recognizeOnceAsync?view=azure-java-stable).
44
47
45
48
```java
46
49
SpeechRecognitionResult result = recognizer.recognizeOnceAsync().get();
47
50
```
48
51
49
-
# [Python](#tab/python)
52
+
::: zone-end
53
+
::: zone pivot="programming-language-python"
50
54
51
55
For more information on using the `recognize_once` function, see the [Python Speech SDK docs](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechrecognizer?view=azure-python#recognize-once------azure-cognitiveservices-speech-speechrecognitionresult).
52
56
53
57
```python
54
58
result = speech_recognizer.recognize_once()
55
59
```
56
60
57
-
***
61
+
::: zone-end
62
+
::: zone pivot="programming-language-more"
63
+
64
+
For additional languages, see the [Speech SDK reference docs](speech-to-text.md#speech-sdk-reference-docs).
65
+
66
+
::: zone-end
58
67
59
68
## Continuous
60
69
61
70
If you need long-running recognition, use the start and corresponding stop functions for continuous recognition. The start function will start and continue processing all utterances until you invoke the stop function, or until too much time in silence has passed. When using the continuous mode, be sure to register to the various events that will fire upon occurrence. For example, the "recognized" event fires when speech recognition occurs. You need to have an event handler in place to handle recognition. A limit of 10 minutes of total speech recognition time, per session is enforced by the Speech service.
For additional languages, see the [Speech SDK reference docs](speech-to-text.md#speech-sdk-reference-docs).
153
+
154
+
::: zone-end
138
155
139
156
## Dictation
140
157
141
158
When using continuous recognition, you can enable dictation processing by using the corresponding "enable dictation" function. This mode will cause the speech config instance to interpret word descriptions of sentence structures such as punctuation. For example, the utterance "Do you live in town question mark" would be interpreted as the text "Do you live in town?".
142
159
143
-
# [C#](#tab/csharp)
160
+
::: zone pivot="programming-language-csharp"
144
161
145
162
For more information on using the `EnableDictation` function, see the [.NET Speech SDK docs](https://docs.microsoft.com/dotnet/api/microsoft.cognitiveservices.speech.speechconfig.enabledictation?view=azure-dotnet#Microsoft_CognitiveServices_Speech_SpeechConfig_EnableDictation).
146
163
@@ -149,7 +166,8 @@ For more information on using the `EnableDictation` function, see the [.NET Spee
149
166
SpeechConfig.EnableDictation();
150
167
```
151
168
152
-
# [C++](#tab/cpp)
169
+
::: zone-end
170
+
::: zone pivot="programming-language-cpp"
153
171
154
172
For more information on using the `EnableDictation` function, see the [C++ Speech SDK docs](https://docs.microsoft.com/cpp/cognitive-services/speech/speechconfig#enabledictation).
155
173
@@ -158,7 +176,8 @@ For more information on using the `EnableDictation` function, see the [C++ Speec
158
176
SpeechConfig->EnableDictation();
159
177
```
160
178
161
-
# [Java](#tab/java)
179
+
::: zone-end
180
+
::: zone pivot="programming-language-java"
162
181
163
182
For more information on using the `enableDictation` function, see the [Java Speech SDK docs](https://docs.microsoft.com/java/api/com.microsoft.cognitiveservices.speech.SpeechConfig.enableDictation?view=azure-java-stable).
164
183
@@ -167,7 +186,8 @@ For more information on using the `enableDictation` function, see the [Java Spee
167
186
SpeechConfig.enableDictation();
168
187
```
169
188
170
-
# [Python](#tab/python)
189
+
::: zone-end
190
+
::: zone pivot="programming-language-python"
171
191
172
192
For more information on using the `enable_dictation` function, see the [Python Speech SDK docs](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechconfig?view=azure-python#enable-dictation--).
173
193
@@ -176,7 +196,13 @@ For more information on using the `enable_dictation` function, see the [Python S
176
196
SpeechConfig.enable_dictation()
177
197
```
178
198
179
-
***
199
+
::: zone-end
200
+
::: zone pivot="programming-language-more"
201
+
202
+
For additional languages, see the [Speech SDK reference docs](speech-to-text.md#speech-sdk-reference-docs).
0 commit comments