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

How to record at 24 or 32 Bit? #5

Open
hales548 opened this issue Apr 23, 2020 · 2 comments
Open

How to record at 24 or 32 Bit? #5

hales548 opened this issue Apr 23, 2020 · 2 comments

Comments

@hales548
Copy link

How do you get the script to record at 24 or 32 bit?

@sb2702
Copy link
Owner

sb2702 commented Apr 23, 2020

It's been a few years since I've worked on this, so I'm not 100% sure this is the right fix, but I think you would need to replace

output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true);

on line 199 of webworker.js with

output.setInt32(offset, s < 0 ? s * 0x80000000 : s * 0x7FFFFFFF, true);

in order to get 32bit output for WAV.

For MP3, you would need to replace the float32toInt function

with


  function float32ToInt(f32){

    return new Int32Array(f32);

  }

This should work, as it inputs 32 bit raw audio to the audio encoders (mp3/ogg etc..), but I don't know 100%, because the actual audio encoders all have different settings, and I didn't write the encoders myself, I just ported different audio encoding libraries and put them together, so you'd need to test that the audio encoders actually output 32 bit audio when you do this.

I can see if I can test this and put in a patch in the next month or so.

@hales548
Copy link
Author

Hi Sam

Many thanks for this. If you manage to put in a patch that would help.

All the best.

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