VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. A Member since June, 2004 Keyser's Avatar
    Join Date
    Feb 2013
    Location
    Westernmost point of Europe
    Search Comp PM
    I want to convert some 24bit/48kHz 2-ch waves to CDDA compatible waves using SoX. I searched the subject and found different command line examples on how to do it.

    In your opinion what is the correct way of doing this? What is the best command line?

    TIA
    "The greatest trick the Devil ever pulled was convincing the world he didn't exist."
    Quote Quote  
  2. Well, I would just go with foobar2000 and foo_dsp_resampler plugin. Resampler plugin is wrapper for SoX. And you dont need command line plugin has GUI.
    Quote Quote  
  3. bellow 15 bit, if it must be really 16 bit then replace 15 by 16 (behind -p, i.e. -p 16) [file will be anyway 16 bit wav compatible with CDDA spec]

    Code:
    @rem  lipshitz, f-weighted, modified-e-weighted, improved-e-weighted, gesemann, shibata, low-shibata, high-shibata 
    @set noiseshape=improved-e-weighted
    @sox --multi-threaded --buffer 131072 -S -V -D %1 %1.wav rate -v -s -I 44100 dither -f %noiseshape% -p 15
    Originally Posted by Detmek View Post
    Well, I would just go with foobar2000 and foo_dsp_resampler plugin. Resampler plugin is wrapper for SoX. And you dont need command line plugin has GUI.
    But you can't control noise shape curve and this is key to keep almost original 24 bit dynamic during requantization.
    Some people like aggressive NS where other prefer rather mild NS.
    Last edited by pandy; 10th Sep 2014 at 08:07.
    Quote Quote  
  4. sox -G input.wav -b 16 output.wav rate -v -s -L -a 44100 dither -a -s
    Quote Quote  
  5. Originally Posted by pandy View Post

    But you can't control noise shape curve and this is key to keep almost original 24 bit dynamic during requantization.
    Some people like aggressive NS where other prefer rather mild NS.
    True, you have to use foobar's dither option as DSP does not have one. I am not sure but I think that foobar uses dither with noise shaping. Could be wrong, though. Anyway, foobar's dither shouldn't be audible.

    P.S. As per Hydrogenudio's TOS#8, can you hear difference in double-blind test?
    Quote Quote  
  6. A Member since June, 2004 Keyser's Avatar
    Join Date
    Feb 2013
    Location
    Westernmost point of Europe
    Search Comp PM
    Thank you guys for all your answers. They really helped me understanding the various important command line options that can be used.
    "The greatest trick the Devil ever pulled was convincing the world he didn't exist."
    Quote Quote  
  7. Originally Posted by Detmek View Post
    True, you have to use foobar's dither option as DSP does not have one.
    But Sox offer better control over various aspects and for offline conversion seem to be perfect - f2k is optimized for real time playback.

    Originally Posted by Detmek View Post
    I am not sure but I think that foobar uses dither with noise shaping. Could be wrong, though. Anyway, foobar's dither shouldn't be audible.
    It can be "flat" TPDF HP

    Originally Posted by Detmek View Post
    P.S. As per Hydrogenudio's TOS#8, can you hear difference in double-blind test?
    Depend from system (dither level) but yes.
    Quote Quote  
  8. Originally Posted by pandy View Post
    But Sox offer better control over various aspects and for offline conversion seem to be perfect - f2k is optimized for real time playback.
    Yes, SoX offers more options but one needs to know how to use those. And when I said "knows" I mean "really understand what those options do", not just how to turn it on or off. Incorrect use can lead to bad results (there was a tread on d9 where guy used weird options for x264 encoding and got bad quality videos).

    Also, there is a question - is this fine tuning necessary? If result is transparent, more tweaking won't improve results.
    Originally Posted by pandy View Post
    Depend from system (dither level) but yes.
    Just because foobar is player it does not mean that its processing capabilities are bad. I did small test with converting 24bit 1khz sine tone and a digital silence to 16bit with and without using foobar's dithering. In both cases noise is at 20kHz and its -86,5dB. I don't think anyone can hear that. Same thing with real song, just the noise flor after nulling was -84dB at 19,5kHz.

    Here are the links to my test files, if you want to check.
    https://mega.co.nz/#F!flRSjJDI!z8Uf9b1KVpZkYsfRln3YtA
    https://mega.co.nz/#F!vgxAwZCR!cUoEvKgpRMO7SGewrrozfQ

    P.S. Sorry, I can not share song due to copyrights. Or, maybe I can cut small clip, under 30 seconds and post it here?

    P.P.S. Oops, I forgot to remove ReplayGain info from files. I reuploaded it again.
    Last edited by Detmek; 10th Sep 2014 at 16:47.
    Quote Quote  
  9. Originally Posted by Detmek View Post
    Yes, SoX offers more options but one needs to know how to use those. And when I said "knows" I mean "really understand what those options do", not just how to turn it on or off. Incorrect use can lead to bad results (there was a tread on d9 where guy used weird options for x264 encoding and got bad quality videos).
    But Sox options are quite well documented - i assume that if someone have problems then he ask - for example on hydrogen.

    Originally Posted by Detmek View Post
    Also, there is a question - is this fine tuning necessary? If result is transparent, more tweaking won't improve results.
    Just because foobar is player it does not mean that its processing capabilities are bad. I did small test with converting 24bit 1khz sine tone and a digital silence to 16bit with and without using foobar's dithering. In both cases noise is at 20kHz and its -86,5dB. I don't think anyone can hear that. Same thing with real song, just the noise flor after nulling was -84dB at 19,5kHz.

    Here are the links to my test files, if you want to check.
    https://mega.co.nz/#F!flRSjJDI!z8Uf9b1KVpZkYsfRln3YtA
    https://mega.co.nz/#F!vgxAwZCR!cUoEvKgpRMO7SGewrrozfQ

    P.S. Sorry, I can not share song due to copyrights. Or, maybe I can cut small clip, under 30 seconds and post it here?
    All depends from many factors - questions are valid but some of those things are highly subjective.
    I have nothing against f2k but Sox from my perspective fit nicely to this task and if we can squeeze 140 - 150 dB dynamics from 16 bit - why not - file size will be exactly the same.

    For testing sample rate conversion and noise shaping.

    sweep
    Code:
    @sox --multi-threaded --buffer 131072 -S -V -D -r 96000 -c 2 -n sweep.sox synth 60 sine 20+24000 gain -n -86
    spectrogram
    Code:
    @sox --multi-threaded --buffer 131072 %1 -n spectrogram -z 144 -w Kaiser -q 248 -x 1024 -o %1.png
    Quote Quote  
  10. OK, advanced resampling is not my strongest side as I don't really know how to use SoX but I just tried to reduce bitdepth of 24 bit silent track to 16bit. I used this command:

    Code:
    @sox %1 -b 16 %1new.wav dither -s -f improved-e-weighted
    Here how plot spectrum looks in Audacity. First image is plot spectrum for SoX file and second is for foobar's dithered file.

    P.S. I don't have anything against command line tools but if I have a nice GUI that does a good job, why not to use it?
    Image Attached Thumbnails Click image for larger version

Name:	0-improved-e-weighted.png
Views:	1189
Size:	15.4 KB
ID:	27396  

    Click image for larger version

Name:	0-foobar2k.png
Views:	1481
Size:	15.7 KB
ID:	27398  

    Image Attached Files
    Quote Quote  
  11. Originally Posted by Detmek View Post
    P.S. I don't have anything against command line tools but if I have a nice GUI that does a good job, why not to use it?
    Because of this:
    http://src.infinitewave.ca
    Quote Quote  
  12. Can you elaborate that? That is resampler test, not dither test. And foobar component I linked is SoX resampler, just made as foobar plugin. In that test it is marked as foo_dsp_resampler, not the one that is named fooBar2000.
    Quote Quote  
  13. NoiseShaping in SoX is covered by this: http://sox.sourceforge.net/SoX/NoiseShaping , as i pointed previously - i have nothing against f2k even if f2k have some problems and errors that make it less useful for me at some cases but it is only one audio player i use from many years.

    Seem that f2k use NS in safe way where SoX can provide also very radical and aggressive NS curves.

    I still miss some decent NS software for example with high level but narrow NS or something useable in sub-Nyquist area - at some point of course Gerzon-Craven theory will be a limit but anyway such software can be nice to have (and yes - i have Sebastian Gesemann tool - something similar but with slightly more complex control will be perfect).
    Quote Quote  
  14. Originally Posted by Detmek View Post
    Well, I would just go with foobar2000 and foo_dsp_resampler plugin. Resampler plugin is wrapper for SoX. And you dont need command line plugin has GUI.
    Originally Posted by Detmek View Post
    Can you elaborate that? That is resampler test, not dither test. And foobar component I linked is SoX resampler, just made as foobar plugin. In that test it is marked as foo_dsp_resampler, not the one that is named fooBar2000.
    Any idea how long foobar_dsp_resampler has been included in that comparison?

    I ask, because I've looked at the comparison before, and I don't recall seeing foobar_dsp_resampler. If I had, I'm sure I would have found it and downloaded it. I have now though. Thanks for pointing it out.
    Quote Quote  
  15. @pandy
    SoX, as I see it, a powerful tool and is more for semi-pro/pro use. Foobar is is audio player but author takes care to implement useful and quality oriented features that should be just enough for regular use, at least for majority of people.

    One NS algorithm does not cover all user cases, as you pointed out, and will not always give a perfect result but, I am visiting HA forum for last couple of years and I started to relay too much on their TOS#8. That means, if I can't hear the difference during regular use - it is good enough for me. I also like to have safe margin, just in case and foobars NS is very high save margin for me. That is why I use it and never tried to learn SoX command line switches. That and I prefer to work with GUIs as I can change settings much faster.

    I need to do more research about NS algorithms but for now I use my free time to learn more about x265 and its quality improvements. New stuff so interesting to play with.

    @hello_hello
    I am not sure. Few months ago it wasn't there. Or I didn't see it. I used it because I found it on HA and I alreay knew that SoX is excelent resampler.
    Last edited by Detmek; 16th Sep 2014 at 01:04.
    Quote Quote  
  16. Originally Posted by Detmek View Post
    @pandy
    SoX, as I see it, a powerful tool and is more for semi-pro/pro use. Foobar is is audio player but author takes care to implement useful and quality oriented features that should be just enough for regular use, at least for majority of people.
    Always you can ask about syntax - most of batches are created once, perhaps refined and they can be used multiple times - f2k is fine from my side - i pointed this that i use in all my systems as basic audio player but conversion from my perspective seem to be easier when done by SoX. So as a player f2k but as a converter SoX especially that f2k have bugs and issues which are not present in SoX (important from my perspective).
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!