Node.js libao bindings, output PCM data to the speakers.
A Writable stream instance that accepts PCM audio data and outputs it to the speakers. The output is backed by libao, which supports a ton of audio backends.
This module is very much based on the awesome node-speaker.
libao installed on your system before installig
$ apt-get install libao-dev
$ brew install libao
Now, simply compile and install
$ npm install libao
A few examples
var libao = ;// Create the libao instancevar ao =channels: 2 // 2 channelsbitDepth: 16 // 16-bit samplessampleRate: 44100 // 44,100 Hz sample rate;// PCM data from stdin gets piped into the speakerprocessstdin;
var fs = ;var wav = ;var libao = ;var file = fs;var reader = ;reader;file;
require('libao') directly returns the
libao constructor. It is the only
interface exported by the module.
new libao([ format ]) -> libao instance;
Creates a new
libao instance, which is a writable stream that you can pipe
PCM audio data to. The optional
format object may contain any of the
base class options, as well as any of these PCM formatting options:
channels- The number of audio channels. PCM data must be interleaved. Defaults to
bitDepth- The number of bits per sample. Defaults to
sampleRate- The number of samples per second per channel. Defaults to
Fired when the backend
open() call has completed. This happens once the first
write() call happens on the ao instance.
Fired after the "flush" event, after the backend
close() call has completed.
This ao instance is essentially finished after this point.