TooTallNate / node-speaker

Output PCM audio data to the speakers
648 stars 145 forks source link

Error: write() failed #90

Open maevesechrist opened 7 years ago

maevesechrist commented 7 years ago

Having an issue on a Rpi 3 where everytime I try to pipe audio to speaker in my code I get Error: write() failed. However the example stdin.js works just fine on the same device.

maevesechrist commented 7 years ago

Reproducible using watson-developer-cloud text-to-speech piping audio to speaker module on Raspberry Pi 3

var speaker = new Speaker({
  channels: 1,
  sampleRate: 22050
});
text_to_speech.synthesize(params).pipe(speaker);

Interestingly the same code on OSX runs fine. Not sure what the difference would be.

ChristianGottinger commented 7 years ago

Did you find a solution? I face the same problem.

maevesechrist commented 7 years ago

Unfortunately no

calebeby commented 7 years ago

I am also having this issue

Flowr-es commented 7 years ago

I'm not sure what is here the issue, but I assume that watson is returning wav. Maybe the OSX can handle this and RPi3 not, but I really don't know. Try to make raw pcm out of it, you can use the wav module.

ahmtcn123 commented 6 years ago

How can I fix this error ?