What is the effect of the “quality” option in MP3 SoX compression?

I convert audio files of several different formats to mp3 using SoX. According to docs , you can use the -C argument to specify compression options such as bit rate and quality, quality after the decimal point, for example:

sox input.wav -C 128.01 output.mp3 (highest quality, slower)

sox input.wav -C 128.99 output.mp3 (lowest quality, faster)

I expected the second to sound terrible, however the sound quality between the two sounds is the same. If so, I don’t understand why one of them works much slower or what I would gain by setting compression to a higher "quality".

Can someone tell me if there is a real difference or advantage in using better compression compared to lower quality?

PS I also checked the file size for each output file, and both of them are exactly the same size. But when hashed, each file exits with a different hash.

+4
source share
2 answers

Parameters are passed to LAME. According to the LAME documentation (section "Choosing an Algorithm Quality" / -q ), the quality value affects the noise generation and the psychoacoustic model used. They recommend quality 2 (i.e. -C 128.2 in SoX), saying that 0 and 1 are much slower, but hardly better.

However, the main factor determining quality remains the bit rate. Therefore, it is not too surprising that in your case there is no noticeable difference.

+2
source

Faster for me with simple

 time sox input.mp3 -C 128 output.mp3 

real 0m7.417s user 0m7.334s sys 0m0.057s

 time sox input.mp3 -C 128.02 output.mp3 

real 0m39.805s user 0m39.430s sys 0m0.205s

0
source

Source: https://habr.com/ru/post/1495624/


All Articles