TooTallNate / node-speaker

Output PCM audio data to the speakers
650 stars 147 forks source link

Default example fails #129

Open asaphaaning opened 5 years ago

asaphaaning commented 5 years ago

The default example fails. Running on Arch Linux x86_64 with alsa-lib installed.

const Speaker = require('speaker');

// Create the Speaker instance
const speaker = new Speaker({
    channels: 2, // 2 channels
    bitDepth: 16, // 16-bit samples
    sampleRate: 44100 // 44,100 Hz sample rate
});

// PCM data from stdin gets piped into the speaker
process.stdin.pipe(speaker);

Result on terminal:

➜  speaker node index.js 
sdfsdf
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: write() failed: 4
    at onwrite (/tmp/speaker/node_modules/speaker/index.js:210:14)