Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit a16eda1

Browse files
authored
Wolfma/readme (#60)
* updated readme with better doc * remove illegal headline formatting
1 parent 3ccbf11 commit a16eda1

File tree

1 file changed

+43
-30
lines changed

1 file changed

+43
-30
lines changed

README.md

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,54 @@
1-
[![npm version](https://badge.fury.io/js/microsoft-speech-browser-SDK.svg)](https://www.npmjs.com/package/microsoft-speech-browser-SDK)
1+
[![npm version](https://badge.fury.io/js/microsoft-speech-browser-sdk.svg)](https://www.npmjs.com/package/microsoft-speech-browser-sdk)
22

3-
## Background
4-
Microsoft's Speech Service is a cloud-based platform that features the most advanced algorithms available for converting spoken audio to text. The Universal Speech Protocol allows you to integrate speech recognition into your application using the Microsoft Speech Service.
3+
## Prerequisites
54

6-
## Install
7-
To install [npm package](https://www.npmjs.com/package/microsoft-speech-browser-SDK) run
5+
### Subscribe to the Speech Recognition API, and get a free trial subscription key
6+
7+
The Speech API is part of Cognitive Services. You can get free trial subscription keys from the [Cognitive Services subscription](https://azure.microsoft.com/try/cognitive-services/) page. After you select the Speech API, select **Get API Key** to get the key. It returns a primary and secondary key. Both keys are tied to the same quota, so you can use either key.
8+
9+
**Note:** Before you can use Speech client libraries, you must have a [subscription key](https://azure.microsoft.com/try/cognitive-services/).
10+
11+
## Get started
12+
13+
In this section we will walk you through the necessary steps to load a sample HTML page. The sample is located in our [github repository](https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript). You can **open the sample directly** from the repository, or **open the sample from a local copy** of the repository.
14+
15+
**Note:** Some browsers block microphone access on un-secure origin. So, it is recommended to host the 'sample'/'your app' on https to get it working on all supported browsers.
16+
17+
### Open the sample directly
18+
19+
Acquire a subscription key as described above. Then open the [link to the sample](https://htmlpreview.github.io/?https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript/blob/preview/samples/browser/Sample.html). This will load the page into your default browser (Rendered using [htmlPreview](https://github.com/htmlpreview/htmlpreview.github.com)).
20+
21+
### Open the sample from a local copy
22+
23+
To try the sample locally, clone this repository:
24+
25+
```
26+
git clone https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript
827
```
9-
npm install microsoft-speech-browser-SDK
28+
29+
compile the TypeScript sources and bundle/browserfy them into a single JavaScript file ([npm](https://www.npmjs.com/) needs to be installed on your machine). Change into the root of the cloned repository and run the commands:
30+
1031
```
32+
cd SpeechToText-WebSockets-Javascript && npm run bundle
33+
```
34+
35+
Open `samples\browser\Sample.html` in your favorite browser.
36+
37+
## Next steps
1138

12-
## JavaScript SDK - Sample Usage
39+
### Installation of npm package
40+
41+
An npm package of the Microsoft Speech Javascript Websocket SDK is available. To install the [npm package](https://www.npmjs.com/package/microsoft-speech-browser-sdk) run
42+
```
43+
npm install microsoft-speech-browser-sdk
44+
```
1345

1446
### As a Node module
1547

1648
If you're building a node app and want to use the Speech SDK, all you need to do is add the following import statement:
1749

1850
```javascript
19-
import * as SDK from 'microsoft-speech-browser-SDK';
51+
import * as SDK from 'microsoft-speech-browser-sdk';
2052
```
2153

2254
<a name="reco_setup"></a>and setup the recognizer:
@@ -98,11 +130,6 @@ function RecognizerStop(SDK, recognizer) {
98130
}
99131
```
100132

101-
102-
### In a Browser, as a native ES6 module
103-
104-
...in progress, check back a little later.
105-
106133
### In a Browser, using Webpack
107134

108135
Currently, the TypeScript code in this SDK is compiled using the default module system (CommonJS), which means that the compilation produces a number of distinct JS source files. To make the SDK usable in a browser, it first needs to be "browserified" (all the javascript sources need to be glued together). Towards this end, this is what you need to do:
@@ -123,28 +150,14 @@ Currently, the TypeScript code in this SDK is compiled using the default module
123150
<script src="../../distrib/speech.sdk.bundle.js"></script>
124151
```
125152

126-
## Try the sample out
127-
What to try the sample ? All you need is a subscription key. [Sign up](https://www.microsoft.com/cognitive-services/en-us/sign-up) to get one.
128-
129-
Here is a handy link to our [Sample](https://htmlpreview.github.io/?https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript/blob/preview/samples/browser/Sample.html) that you can try out. (Rendered using [htmlPreview](https://github.com/htmlpreview/htmlpreview.github.com))
130-
131-
To try the sample locally, please clone this repository:
132-
```
133-
git clone https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript
134-
```
153+
### In a Browser, as a native ES6 module
135154

136-
compile the TypeScript sources and bundle/browserfy them into a single JavaScript file:
155+
...in progress, will be available soon
137156

138-
```
139-
cd SpeechToText-WebSockets-Javascript && npm run bundle
140-
```
141-
142-
open `samples\browser\Sample.html` in your favorite browser.
157+
### Token-based authentication
143158

144159
To use token-based authentication, please launch a local node server, as described [here](https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript/blob/master/samples/browser/README.md)
145160

146-
**Note:** Some browsers block microphone access on un-secure origin. So, it is recommended to host the 'sample'/'your app' on https to get it working on all supported browsers.
147-
148161
## Docs
149162
The SDK is a reference implementation for the speech websocket protocol. Check the [API reference](https://docs.microsoft.com/en-us/azure/cognitive-services/speech/API-reference-rest/bingvoicerecognition#websocket) and [Websocket protocol reference](https://docs.microsoft.com/en-us/azure/cognitive-services/speech/API-reference-rest/websocketprotocol) for more details.
150163

0 commit comments

Comments
 (0)