2.0.2 • Published 7 years ago

morphet-bingspeech-api-client v2.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

bingspeech-api-client

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

TTS usage example (recognize)

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

// audio input in a Buffer
let wav = fs.readFileSync('myaudiofile.wav');

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

let client = new BingSpeechClient(subscriptionKey);
client.recognize(wav)
      .then(response => {
          console.log(response.results[0].name);
      });

STT usage example (synthesize)

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

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

let client = new BingSpeechClient(subscriptionKey);
client.synthesize('I have a dream')
      .then(response => {
          // audio is a Buffer in response.wave
      });