Manoa1911
20 bit provides a very good compromise between file sizes and recorded quality, it exists in cool edit pro and earlier versions of audition as well as WaveLab 13, many sound cards do not provide the ability to change depth at recording time or do so in software as post (when in ASIO mode), your program has very good convertion quality, I do know that 20-bit wav does not reduce the wave size but it does significantly reduce it when from 20 bits converted to a compressing lossless format ! in the 40% range !. the dynamic range of 24 bits is far too excessive/redundant and this can greatly help reduce wasted space on unheard bits :) ``` ReSampler.exe -i "D:\A1.wav" -o "D:\A1-20.alac" -r 96000 -b alac20 -n 0.99 --minphase --noClippingProtection --singleStage --doubleprecision --nodither 2.1.1 64-bit version AVX build ... Input file: D:\A1.wav Output file: D:\A1-20.alac clipping protection disabled Warning: NOT Changing output file bit format ! Warning: NOT Changing output file format ! (extension different, but format will remain the same) Using double precision for calculations. input bit format: 24 source file channels: 2 input sample rate: 96000 output sample rate: 96000 Scanning input file for peaks ...Done Peak input sample: 1.000000 (0.000000 dBFS) at 0:1:18.417510 Normalizing to 0.99 LPF transition frequency: 43636.36 Hz (90.91 %) Using Minimum-Phase LPF Conversion ratio: 1.000000 (1:1) Writing Metadata Converting (single-stage) ... Writing to output file ... Done Peak output sample: 0.990000 (-0.087296 dBFS) Time=5216 ms [84.5x] ``` after some battle I found how to do it, but it gives a tons of errors: ``` ReSampler.exe -i "E:\A1.wav" -o "E:\A1-20.caf" -r 96000 -b alac20 -n 0.99 --minphase --noClippingProtection --singleStage --doubleprecision --nodither ``` ``` compressed frame too big: 166404 vs. 163856 ``` I found out the error spam is not fatal but the output file is empty :( it only 68 bytes ? updated: windows-only bug, on Linux built from source no problems :) the file is written but the frame too big causes noise in the output file :( the problem appears to be located in alac/alac_encoder.c in sndfile: ``` /* if we happened to create a compressed packet that was actually bigger than an escape packet would be, chuck it and do an escape packet */ minBits = BitBufferGetPosition (bitstream) - BitBufferGetPosition (&startBits) ; if (minBits >= escapeBits) { *bitstream = startBits ; // reset bitstream state doEscape = true ; printf ("compressed frame too big: %u vs. %u \n", minBits, escapeBits) ; } ``` I tried to skip this code but there was no change in the output file, the message is gone but the file is still damaged :( I also noticed that increasing output sample rate fixes the problem :) the damage is noise on the left channel at which time there is mute on the right channel there are no problems when output in alac24 :) attempt to bypass the problem by first convert to alac24 and from alac24 to alac20 fail with exact same problem :( sampling rate increase required for clean output is significant :( from 96k I had to set 130k !!! :( tested many other temporary formats like WAVEX-64, 32F, wmaL, AIFF, FLAC, but the program either refused to convert or output was equally as damaged :( a funny thing happened :D: when converted to alac16 insted of 20, there were no error messages and output was correct ! I guess this kind of problems are a good reason to add 20-bit wav support ?