GithubHelp home page GithubHelp logo

palmerabollo / bingspeech-api-client Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 17.0 213 KB

Microsoft Bing Speech API client in node.js

License: Other

TypeScript 100.00%
bing-speech speech-to-text stt text-to-speech tts

bingspeech-api-client's Introduction

Hi ๐Ÿ‘‹ I love building things that work

Ping me if you need help building something that makes the world a better place.

Buy Me A Coffee

bingspeech-api-client's People

Contributors

carlousf avatar dependabot[bot] avatar jantielens avatar marcbachmann avatar morphet81 avatar palmerabollo avatar pietrop avatar reesilva avatar reflash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bingspeech-api-client's Issues

Missing dependency: debug

See src/client.js: you haven't declared it as a dependency in package.json though. Worked around by requiring in my own package for now.

Issue with `import`

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

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

I think at present node does not support import. As mentioned on MDN

Note: This feature[import] 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.

Unable to assign fs.ReadStream to NodeJS.ReadWriteStream

As per the README,

I created a new ReadStream by

let audioStream = fs.createReadStream(myFileName);

then in

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

recognizeStream method, the type expected is NodeJS.ReadWriteStream but audioStream is fs.ReadStream, though I found that NodeJS.ReadWriteStream extends both ReadableStream and WriteableStream, but still I am getting error in Typescript transpiler.

 TS2345: Argument of type 'ReadStream' is not assignable to parameter of type 'ReadWriteStream'.
  Types of property 'setEncoding' are incompatible.
    Type '(encoding: string) => ReadStream' is not assignable to type '(encoding: string) => ReadWriteStream'.
      Type 'ReadStream' is not assignable to type 'ReadWriteStream'.

Can you suggest what can I do?

Module is not able to do Speech to text conversion - (STT ) Conversion - Returning 404 response with invalid token

After much debugging I found out this is because of missing 'Ocp-Apim-Subscription-Key'.

Response in node.js ๐Ÿ‘

(node:80377) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Voice recognition failed miserably: Wrong status code 404 in Bing Speech API / token

For some reason this is not getting set even after an object was creating by passing the 'MICROSOFT_BING_SPEECH_KEY'

Return a stream to support pipes

The synthesize function should return a stream. This way a client could pipe the result without waiting to receive and store the audio in memory.

How to play received audio stream?

I am using following function,

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 => /* ... */);

I am receiving data on the readable event and getting buffer data. Can anyone let me know, how can I play that audio?

When I'm trying to execute this code its giving error like

down vote
favorite
When I'm trying to execute this code its giving error like

(node:3784) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec tion id: 1): Error: Voice recognition failed miserably: socket hang up

var fs = require('fs');
var bing = require('C:\Program Files\nodejs\node_modules\bingspeech-api-client\lib\client.js');

var audioStream = fs.createReadStream('d:\node.wav');

var subscriptionKey = 'xxxxxxxxxxxxxxxxx';

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

http://stackoverflow.com/questions/42570738/speech-to-text-bing-speech-api-azure

streaming with microphone: nothing happens ?

i am having problems making the streaming work ...

  • for STT streaming example i get no response and no timeout (i give it node-record-lpcm16 stream )
  • for TTS streaming example i get the response, but piping the stream to speaker just gives me a short noise sound ( i set the output format to 16bit 16khz mono pcm and used nodejs Speaker )

buffer examples seem to work ok

Add sockets support?

Hey @palmerabollo,
Have you thought about adding support for socket connection in the underlying implantation?

Not sure where to start but I'd be happy to help with that!

Advantages are that it raises the audio duration limit from 15 seconds for REST API to 10 minutes for socket, for the Bing STT service, according Microsoft documentation.

Let me know if this is on your roadmap.

Add support to pt-BR female

Bing Speech now supports female pt-BR voices. I'll open this issue and submit a PR to associate, that implements this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.