From: Cory N. <ph...@gm...> - 2011-12-16 17:40:05
|
On Fri, Dec 16, 2011 at 6:33 AM, Ulrich Klauer <ul...@ch...> wrote: > Cory Nelson <ph...@gm...>: > >>> sox -S -V4 -G in-44k.flac -b 24 out-192k.wav rate -v 192k >> >> And I get this debug output, showing 16-bit precision but 24-bit encoding: >> sox INFO sox: effects chain: input 44100Hz 2 channels 16 bits (multi) >> ... >> >> sox INFO sox: effects chain: dither 192000Hz 2 channels 32 bits >> sox INFO sox: effects chain: output 192000Hz 2 channels 16 bits >> (multi) >> >> I thought this odd so I went and checked the file -- indeed it is >> 24-bit with every 3rd byte set to 0, consistent with this debug >> output. >> >> Is it possible to get true untruncated 24-bit output with a single >> command line? No matter what I try, the output precision gets set to >> the input's. I've worked around it for now by making a temporary >> 32-bit file first, but it's a bit of a hassle. > > > First, in your specific case, the simplest solution is to use --no-dither > (-D). > -D stopped the dither, but unfortunately the output filter is still 16-bit. > > This won't solve it in the general case, however; 8-bit source material that > is to be processed in some way, and the result to be written to CD (16 bit, > dithered), would be an example. I don't see a way to do this without a > temporary file at the moment. > > I wrote some changes to how this output/dither precision works a while ago, > but I am not really sure about their impact, so I haven't submitted them yet > (and perhaps won't do it at all, if they introduce other problems). Any > comments/tests are welcome, so I am attaching the patches against current > git master to this message. With these applied, your command line above > would do what you expected it to do; additionally, there is a new -p option > to dither for explicitly setting the target precision. (Can also be used to > compare noise shaping filters: play ex.wav dither -p 6; play ex.wav dither > -f shibata -p 6; play ex.wav dither -f lipshitz -p 6; etc.) > > Ulrich This seems like a wonderful patch, I'd love to test it out if someone could supply win32 binaries. -- Cory Nelson |