3.1.0 • Published 4 years ago

bingspeech-api-client v3.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

bingspeech-api-client

A Microsoft Bing Speech API client written in node.js.

Official documentation for Bing Speech API service.

To work with Bing Speech API, you must have a subscription key. If you don't have a subscription key already, get one here: Subscriptions.

Usage

Install bingspeech-api-client in your node project with npm.

npm install --save bingspeech-api-client

See example below on how to require and use for Speech to text (STT) and text to speech (TTS).

Examples

Following example code is assuming you are using typescript. If you are, skip this section and go straight to the examples. But if you are using node ES6 and want to use the example code read on.

At present node does not support import. As mentioned on MDN

Note: This featureimport is only beginning to be implemented in browsers natively at this time. It is implemented in many transpilers, such as the Traceur Compiler, Babel, Rollup or Webpack.

To get the example code working change the first line to:

const { BingSpeechClient, VoiceRecognitionResponse } = require('bingspeech-api-client');

STT usage example (recognize)

import { BingSpeechClient, VoiceRecognitionResponse } from 'bingspeech-api-client';

let audioStream = fs.createReadStream(myFileName); // create audio stream from any source

// Bing Speech Key (https://www.microsoft.com/cognitive-services/en-us/subscriptions)
let subscriptionKey = 'your_private_subscription_key';

let client = new BingSpeechClient(subscriptionKey);
client.recognizeStream(audioStream).then(response => console.log(response.results[0].name));

TTS usage example (synthesize)

import { BingSpeechClient, VoiceVoiceSynthesisResponse } from 'bingspeech-api-client';

// Bing Speech Key (https://www.microsoft.com/cognitive-services/en-us/subscriptions)
let subscriptionKey = 'your_private_subscription_key';

let client = new BingSpeechClient(subscriptionKey);
client.synthesizeStream('I have a dream').then(audioStream => /* ... */);
3.1.0

4 years ago

3.0.0

4 years ago

2.6.0

4 years ago

2.5.1

5 years ago

2.5.0

6 years ago

2.4.2

6 years ago

2.4.1

6 years ago

2.3.1

7 years ago

2.2.0

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago