diff --git a/samples/browser/Sample.html b/samples/browser/Sample.html
index 77107ac..94d4d81 100644
--- a/samples/browser/Sample.html
+++ b/samples/browser/Sample.html
@@ -18,9 +18,22 @@
Speech Recognition
Microsoft Cognitive Services
+
+ | Recognition API: |
+
+
+ |
+
+
+ Custom Speech Endpoint ID (leave blank for Bing Speech): |
+ |
+
| Subscription: |
- |
+ |
| Language: |
@@ -137,7 +150,7 @@ Microsoft Cognitive Services
}
// Setup the recognizer
- function RecognizerSetup(SDK, recognitionMode, language, format, subscriptionKey) {
+ function RecognizerSetup(SDK, recognitionMode, language, format, subscriptionKey, recognitionAPI, endpointId) {
switch (recognitionMode) {
case "Interactive" :
@@ -153,6 +166,18 @@ Microsoft Cognitive Services
recognitionMode = SDK.RecognitionMode.Interactive;
}
+ switch (recognitionAPI) {
+ case "Bing Speech":
+ recognitionAPI = SDK.RecognitionAPI.BingSpeech;
+ break;
+ case "Custom Speech":
+ recognitionAPI = SDK.RecognitionAPI.CustomSpeech;
+ break;
+ default:
+ recognitionAPI = SDK.RecognitionAPI.BingSpeech;
+ break;
+ }
+
var recognizerConfig = new SDK.RecognizerConfig(
new SDK.SpeechConfig(
new SDK.Context(
@@ -160,8 +185,9 @@ Microsoft Cognitive Services
new SDK.Device("SpeechSample", "SpeechSample", "1.0.00000"))),
recognitionMode,
language, // Supported languages are specific to each recognition mode. Refer to docs.
- format); // SDK.SpeechResultFormat.Simple (Options - Simple/Detailed)
-
+ format, // SDK.SpeechResultFormat.Simple (Options - Simple/Detailed)
+ recognitionAPI, // supports Bing Speech and Custom Speech
+ endpointId); // Custom Speech subscription key, see https://cris.ai portal
var useTokenAuth = false;
@@ -267,10 +293,10 @@ Microsoft Cognitive Services