bingspeech-api-client
bingspeech-api-client copied to clipboard
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?
I'm also very interested on this. So far I was only able to play the audio on the speakers using the .synthesize
method and passing the audioResponse.wave
to a wav
reader following the example here
While it does work, it uses the .synthesize
method and not the synthesizeStream
which looks it's the way to go. I use the later and try to pass the audioStream
directly to the wav reader but I get white noise audio on the speaker.
@palmerabollo any idea about this? The bottom line is how to use synthesizeStream
and pipe the stream audio to the speaker. Thanks!
@dataoracle @mitulgolakiya I have no experience with that, sorry. Did you finally manage to solve it?