Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sampleFormat confusion #37

Open
SAERobinReumers opened this issue Nov 15, 2014 · 1 comment
Open

sampleFormat confusion #37

SAERobinReumers opened this issue Nov 15, 2014 · 1 comment

Comments

@SAERobinReumers
Copy link

Hi, first of all thank you very much for this very useful module.

I have been reading the docs but I'm a bit confused. SampleFormat in the documentation says:

sampleFormat [default sampleFormatFloat32]
Bit depth - Number of bits used to represent sample values
formats are sampleFormatFloat32, sampleFormatInt32, sampleFormatInt24, sampleFormatInt16, sampleFormatInt8, sampleFormatUInt8.

However, when I try:
engine.setOptions({
sampleFormat: "sampleFormatInt16",
});
it doesn't change anything. I did see that I can change it between 1 and 2. 1 seems be the floating value and 2 seems to be integer based, however I don't know if it's 20bit or something similar?
The highest value seems to go to 95.000.000 which is higher than 16-bit but a lot lower than 24-bit. Any input on this would be much appreciated.

@madsci77
Copy link

I realize it's been a few years, but I'll chime in with what I've found for anyone else looking at this.

I'm new to Node and I'm not sure how those enumerations are supposed to work - I can't find them anywhere. But I did find the code where they're defined:

target->Set( Nan::New<String>("sampleFormatFloat32").ToLocalChecked(), Nan::New<Number>(1)); target->Set( Nan::New<String>("sampleFormatInt32").ToLocalChecked(), Nan::New<Number>(2) ); target->Set( Nan::New<String>("sampleFormatInt24").ToLocalChecked(), Nan::New<Number>(4) ); target->Set( Nan::New<String>("sampleFormatInt16").ToLocalChecked(), Nan::New<Number>(8) ); target->Set( Nan::New<String>("sampleFormatInt8").ToLocalChecked(), Nan::New<Number>(10) ); target->Set( Nan::New<String>("sampleFormatUInt8").ToLocalChecked(), Nan::New<Number>(20) );

That at least gives you the numbers to use - Int16 is 8, and it gives me the expected numeric range.

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

No branches or pull requests

2 participants