A Node.js streaming libary and command line tool that converts Apple Lossless (ALAC) audio to raw PCM audio
A Node.js streaming libary and command line tool that converts Apple Lossless (ALAC) audio to raw PCM audio.
Install as a global module:
npm install -g alac2pcm
Pipe binary ALAC bytes into STDIN and, alac2pcm will output raw PCM audio bytes on STDOUT:
cat audio.alac | alac2pcm > audio.pcm
For a list of available configuration options, write:
alac2pcm --help
Install as a local module:
npm install --save alac2pcm
Then you can just use it as a regular node stream:
var Alac2Pcm = require('alac2pcm')
var options = {
bitDepth: 8
}
var alac2pcm = new Alac2Pcm(options)
sourceAlacStream.pipe(alac2pcm).pipe(pcmPlayer)
When instantiating the Alac2Pcm
object an optional options object can
be provided:
frameLength
- (default: 352) Indicating the frames per packet whenbitDepth
- (default: 16) Describes the bit depth of the source PCMchannels
- (default: 2) Describes the channel count (1 = mono, 2 =maxFrameBytes
- (default: 0) The maximum size of an Apple LosslessavgBitRate
- (default: 0) The average bit rate in bits per second ofsampleRate
- (default: 44100) Sample rate of the encoded streamAditional, but currently unused options:
compatibleVersion
- (default: 0) Indicating compatible version.pb
- (default: 40) Currently unused tuning parameter. Value shouldmb
- (default: 10) Currently unused tuning parameter. Value shouldkb
- (default: 14) Currently unused tuning parameter. Value shouldmaxRun
- (default: 255) Currently unused. Value should be set to 255MIT