lib/decoder.js
function Decoder (opts) {
  if (!(this instanceof Decoder)) {
    return new Decoder(opts);
  }
  Transform.call(this, opts);
  var ret;

  ret = binding.mpg123_new(opts ? opts.decoder : null);
  if (Buffer.isBuffer(ret)) {
    this.mh = ret;
  } else {
    throw new Error('mpg123_new() failed: ' + ret);
  }

  ret = binding.mpg123_open_feed(this.mh);
  if (MPG123_OK != ret) {
    throw new Error('mpg123_open_feed() failed: ' + ret);
  }
  debug('created new Decoder instance');
}
function Decoder (opts) {
  if (!(this instanceof Decoder)) {
    return new Decoder(opts);
  }
  Transform.call(this, opts);
  var ret;

  ret = binding.mpg123_new(opts ? opts.decoder : null);
  if (Buffer.isBuffer(ret)) {
    this.mh = ret;
  } else {
    throw new Error('mpg123_new() failed: ' + ret);
  }

  ret = binding.mpg123_open_feed(this.mh);
  if (MPG123_OK != ret) {
    throw new Error('mpg123_open_feed() failed: ' + ret);
  }
  debug('created new Decoder instance');
}
function Decoder ( opts ) { if ( ! ( this instanceof Decoder ) ) { return new Decoder ( opts ) ; } Transform . call ( this , opts ) ; var ret ; ret = binding . mpg123_new ( opts ? opts . decoder : null ) ; if ( Buffer . isBuffer ( ret ) ) { this . mh = ret ; } else { throw new Error ( 'mpg123_new() failed: ' + ret ) ; } ret = binding . mpg123_open_feed ( this . mh ) ; if ( MPG123_OK != ret ) { throw new Error ( 'mpg123_open_feed() failed: ' + ret ) ; } debug ( 'created new Decoder instance' ) ; }
`Decoder` Stream class.
Accepts an MP3 file and spits out raw PCM data.
Decoder Stream class . Accepts an MP3 file and spits out raw PCM data .