Floating point WAV/AIFF recording
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Wishlist
|
JosepMa |
Bug Description
Recording to WAV/AIFF currently uses 16-bit PCM: https:/
As I understand it, Mixxx uses floating point internally, and so when it writes samples later on in that code, they are converted to 16-bit integers by libsndfile. The normalization mode is set here: https:/
I would like to record WAV/AIFF in floating point directly, instead. I'm doing this to eventually produce a FLAC file, and I'd like to, in "post-production", do volume normalization on the raw floating point data and then dither to 16-bit with other, higher-
The particular irritation I have with libsndfile's conversion to 16-bit (aside from the knawing sense that some in-between levels produced by EQ/filters are being tossed out) is that if I *ever* clip, there's a very noticeable pop when the sample "wraps around" as if there was a simple integer overflow in that code. I would prefer to treat that with a limiter in post. With MP3/Ogg recording (I only tried MP3), the samples above 0dB are clamped, which distorts the audio, but doesn't produce the "pop" (which I assume is why most people haven't noticed/don't care about it, loud distortion sounds normal these days :-))
I think it is better to simply change Mixxx's WAV/AIFF recording to floating point rather than adding an option. MP3/Ogg will still convert to 16-bit PCM and that's what most people will need/default to. If they're looking for WAV/AIFF output, they presumably want the highest quality possible (if they just want to run their own fancy MP3 encoder on it, it should also be able to handle limiting and dithering). I think this should just be a matter of changing the flags used to open the file (lines 284/286) and removing the sf_command call (line 298). If I had a build environment set up, I'd try it... I can send a pull request anyway if you want.
Changed in mixxx: | |
assignee: | nobody → JosepMa (josepma) |
Changed in mixxx: | |
status: | Confirmed → In Progress |
Changed in mixxx: | |
status: | In Progress → Fix Committed |
Changed in mixxx: | |
milestone: | none → 2.1.0 |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
+1 for removing the libsndfile normalization
+1 for adding an option for floating point output
-1 for making floating point wav output default (since this not the most common format)
Thank you for reporting the bug and offering your help.
What about adding a preference option for the wave sample format. portaudio. com/docs/ v19-doxydocs- dev/pa_ _converters_ 8c.html instead of the libsndfile version.
Portaudio offers function for float to S16 conversion including dithering. We should use this: http://
In case of clipping, clamping is the best solution. We do it elsewhere in Mixxx and it is in charge of the user to avoid it.
Once it is available, the user can add a compressor effect to the master channel to address the issue explicit.
Do you need help with the first steps? www.mixxx. org/wiki/ doku.php/ bugfix_ workflow
This might be helpful as well: http://