streamproc / MediaStreamRecorder

Cross browser audio/video/screen recording. It supports Chrome, Firefox, Opera and Microsoft Edge. It even works on Android browsers. It follows latest MediaRecorder API standards and provides similar APIs.
https://www.webrtc-experiment.com/msr/
MIT License
2.62k stars 563 forks source link

Float32 to Int16 in StereoAudioRecorderHelper.js #176

Open crky14 opened 4 years ago

crky14 commented 4 years ago

Current implementation is multiplying Float32 number in range (-1,1) by 0xFFFF which is eqvivalent to 65535. I found that with this conversion data is incorrect.

By som googling I found that using this:

num < 0 ? num * 0x8000 : num * 0x7FFF;

Im getting results equivalent to numpy implementation.

Is this a issue or I got something wrong ?