Skip to content

Conversation

@mdluo
Copy link

@mdluo mdluo commented Apr 25, 2018

Relevant issue: #52

Previous PR: #83

First call mpg123_format_none to clear the output format table, then call mpg123_format to set the output format based on the option parameter of the Decoder constructor.

Encoding table: https://github.com/TooTallNate/node-lame/blob/master/deps/mpg123/src/libmpg123/mpg123.h.in#L348-L388

mpg123_format_none: https://www.mpg123.de/api/group__mpg123__output.shtml#ga931ca238347de394901c3baa13e7a8f8

mpg123_format: https://www.mpg123.de/api/group__mpg123__output.shtml#gadad5794afc300a997e517dbe397dc2c7

Inspired by: https://sourceforge.net/p/mpg123/mailman/message/25123550/

var channels = opts.channels || (MPG123_MONO | MPG123_STEREO);
var signed = opts.signed ? MPG123_ENC_SIGNED : 0;
var float = opts.float ? MPG123_ENC_FLOAT : 0
var bitDepth = MPG123_ENC_8 | MPG123_ENC_16 | MPG123_ENC_24 | MPG123_ENC_32;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line correct? 🤔 why are we oring them together?

Copy link
Collaborator

@LinusU LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thing I'm wondering about...

@LinusU
Copy link
Collaborator

LinusU commented Apr 26, 2018

Looks great!

@dcerisano
Copy link

dcerisano commented Mar 17, 2019

Doesn't that make Decoder a Transcoder?
I think it means: don't have to format a new instance of Speaker every time.
Should be able to create a singleton instance with the fixed format given to the lame decoder output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants