Skip to content

Commit 8ccd08a

Browse files
author
Trevor Bye
committed
Merge branch 'rhurey/JS.Samples' of https://github.com/rhurey/azure-docs-pr
2 parents 2176427 + f54cea3 commit 8ccd08a

23 files changed

+1546
-15
lines changed

articles/cognitive-services/Speech-Service/how-to-choose-recognition-mode.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ ms.service: cognitive-services
99
ms.subservice: speech-service
1010
ms.topic: conceptual
1111
ms.date: 03/10/2020
12-
ms.author: trbye
13-
zone_pivot_groups: programming-languages-set-two
12+
ms.author: dapine
13+
zone_pivot_groups: programming-languages-speech-services-one-nomore
1414
---
1515

1616
# Choose a speech recognition mode
@@ -64,7 +64,15 @@ result = speech_recognizer.recognize_once()
6464
For additional languages, see the [Speech SDK reference docs](speech-to-text.md#speech-sdk-reference-docs).
6565

6666
::: zone-end
67+
::: zone pivot="programming-language-javascript"
6768

69+
For more information on using the `recognizeOnceAsync` function, see the [JavaScript Speech SDK docs](https://docs.microsoft.com/javascript/api/microsoft-cognitiveservices-speech-sdk/speechrecognizer?view=azure-node-latest#recognizeonceasync--e--speechrecognitionresult-----void---e--string-----void-).
70+
71+
```JavaScript
72+
recognizer.recognizeOnceAsync((result)=>{}, (error)=>{}));
73+
```
74+
75+
::: zone-end
6876
## Continuous
6977

7078
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.
@@ -151,6 +159,24 @@ speech_recognizer.stop_continuous_recognition()
151159

152160
For additional languages, see the [Speech SDK reference docs](speech-to-text.md#speech-sdk-reference-docs).
153161

162+
::: zone-end
163+
::: zone pivot="programming-language-javascript"
164+
165+
```JavaScript
166+
recognizer.recognized = (s, e) => {
167+
if (e.result.reason == ResultReason.RecognizedSpeech) {
168+
// Do something with the recognized text
169+
// e.getResult().getText()
170+
}
171+
});
172+
173+
// Start continuous speech recognition
174+
recognizer.startContinuousRecognitionAsync(()=>{}, (error)=>{});
175+
176+
// Stop continuous speech recognition
177+
recognizer.stopContinuousRecognitionAsync(()=>{}, (error)=>{});
178+
```
179+
154180
::: zone-end
155181

156182
## Dictation
@@ -201,6 +227,16 @@ SpeechConfig.enable_dictation()
201227

202228
For additional languages, see the [Speech SDK reference docs](speech-to-text.md#speech-sdk-reference-docs).
203229

230+
::: zone-end
231+
::: zone pivot="programming-language-javascript"
232+
233+
For more information on using the `enableDictation` function, see the [JavaScript Speech SDK docs](https://docs.microsoft.com/javascript/api/microsoft-cognitiveservices-speech-sdk/speechconfig?view=azure-node-latest#enabledictation--).
234+
235+
```JavaScript
236+
// Enable diction
237+
speechConfig.enableDictation();
238+
```
239+
204240
::: zone-end
205241

206242
## Next steps

articles/cognitive-services/Speech-Service/how-to-phrase-lists.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ ms.service: cognitive-services
99
ms.subservice: speech-service
1010
ms.topic: conceptual
1111
ms.date: 02/04/2020
12-
ms.author: trbye
13-
zone_pivot_groups: programming-languages-set-two
12+
ms.author: dapine
13+
zone_pivot_groups: programming-languages-speech-services-one-nomore
1414
---
1515

1616
# Phrase Lists for speech-to-text
@@ -72,7 +72,7 @@ phrase_list_grammar.addPhrase("Move to Ted")
7272

7373
::: zone-end
7474

75-
::: zone pivot="programming-language-more"
75+
::: zone pivot="programming-language-javascript"
7676

7777
```JavaScript
7878
var phraseListGrammar = SpeechSDK.PhraseListGrammar.fromRecognizer(reco);

articles/cognitive-services/Speech-Service/how-to-specify-source-language.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.subservice: speech-service
1010
ms.topic: conceptual
1111
ms.date: 01/07/2020
1212
ms.author: qiohu
13-
zone_pivot_groups: programming-languages-set-two
13+
zone_pivot_groups: programming-languages-speech-services-one-nomore
1414
---
1515

1616
# Specify source language for speech to text
@@ -137,7 +137,7 @@ speech_recognizer = speechsdk.SpeechRecognizer(
137137
138138
::: zone-end
139139

140-
::: zone pivot="programming-language-more"
140+
::: zone pivot="programming-language-javascript"
141141

142142
## How to specify source language in Javascript
143143

@@ -158,7 +158,9 @@ If you're using a custom model for recognition, you can specify the endpoint wit
158158
```Javascript
159159
speechConfig.endpointId = "The Endpoint ID for your custom model.";
160160
```
161+
::: zone-end
161162

163+
::: zone pivot="programming-language-javascript"
162164
## How to specify source language in Objective-C
163165

164166
The first step is to create a `speechConfig`:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: "Quickstart: Recognize speech stored in blob storage, C# - Speech service"
3+
titleSuffix: Azure Cognitive Services
4+
description: TBD
5+
services: cognitive-services
6+
author: erhopf
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: speech-service
10+
ms.topic: include
11+
ms.date: 10/28/2019
12+
ms.author: erhopf
13+
---
14+
15+
> [!div class="nextstepaction"]
16+
> [Explore C# samples on GitHub](https://aka.ms/speech/github-csharp)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "Quickstart: Recognize speech stored in blob storage, JavaScript - Speech service"
3+
titleSuffix: Azure Cognitive Services
4+
description: TBD
5+
services: cognitive-services
6+
author: erhopf
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: speech-service
10+
ms.topic: include
11+
ms.date: 10/28/2019
12+
ms.author: erhopf
13+
---
14+
15+
If you prefer to jump right in, view or download all <a href="https://aka.ms/speech/github-javascript">Speech SDK JavaScript Samples</a> on GitHub. Otherwise, let's get started.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: "Quickstart: Recognize speech stored in blob storage, JavaScript - Speech service"
3+
titleSuffix: Azure Cognitive Services
4+
description: TBD
5+
services: cognitive-services
6+
author: erhopf
7+
manager: nitinme
8+
ms.service: cognitive-services
9+
ms.subservice: speech-service
10+
ms.topic: include
11+
ms.date: 10/28/2019
12+
ms.author: erhopf
13+
zone_pivot_groups: programming-languages-set-two
14+
---
15+
16+
[!INCLUDE [NodeJS](./node.md)]

0 commit comments

Comments
 (0)