Skip to main content

Topic: Encoding AAC help (Read 1290 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
Encoding AAC help
Hi, so I'm using foobar to convert FLAC to Apple AAC with custom settings, I used qaac.exe that is here and I'm asking because I mainly convert Hi res vinyls and sometimes they are not normalized, I check in Audacity with Normalizing and adjusting the db to -0.1 and sometimes the waveform amplifies, meaning they were not normalized before. I want to amplify the audio without clipping, what is the correct way to do it? Should I first "norm=-0.1"  the whole image with SoX batch converter? Or which settings should I use on foobar? I know qaac.exe uses SoX as resampler by default, but I don't know which settings are the correct ones for the ones I need, I'm not too good in these command things but I want to keep the best audio possible with all AAC has to offer. Oh and I'm asking to normalize the whole image beause I don't want some calm tracks to sound loud.

These are the settings I already have on foobar
Code: [Select]
--ignorelength -s --no-optimize -V 118 --rate 44100 -o %d -

I was also thinking that I could use my SoX batch converter to convert them to AAC? is it possible? This is the .bat I have on my SoX folder, which I use it for WAV>FLAC or FLAC>FLAC

Code: [Select]
@ECHO OFF
SETLOCAL
%SYSTEMDRIVE%
ECHO %PROCESSOR_ARCHITECTURE% | FINDSTR AMD64>NUL && SET ARCH=AMD64 || SET ARCH=x86
IF %ARCH%==AMD64 SET DIRECTORY=%PROGRAMFILES(X86)%
IF %ARCH%==x86 SET DIRECTORY=%PROGRAMFILES%
CD "%DIRECTORY%"
FOR /f %%x IN (
'DIR /AD /B * ^| FINDSTR "^sox-[0-9].*$"'
) DO SET SOXDIR=%DIRECTORY%\%%x
%~D0
CD %~DP0
@ECHO ON
MKDIR converted
FOR %%A IN (%*) DO  sox -S -V4 --norm=-0.1 %% "converted/%%~nxA" rate -v 44100 stat -v
@PAUSE

Can someone guide me please? I don't want to alter lossless audio files for archiving.

Thank you for your patience.





  • Last Edit: 29 December, 2016, 04:44:44 PM by Kohlrabi

  • DVDdoug
  • [*][*][*][*][*]
Re: Enconding AAC help
Reply #1
Quote
I check in Audacity with Normalizing and adjusting the db to -0.1 and sometimes the waveform amplifies, meaning they were not normalized before. I want to amplify the audio without clipping, what is the correct way to do it?
That's one way to do it.   Audacity also has a Normalize  effect with a couple of additional features/options.  If you're going to normalize in Audacity of course no need to worry about doing it again in SoX or foobar.    Or, you should be able to do the normalizing & encoding with one line in SoX.    (I don't use foobar, so someone else will have to help you with it.) 

Personally, I normalize to 0dB.  Nothing bad happens until you try to go over  0dB.*  However, AAC is lossy, the wave shape will change, some of your peaks will increase and other peaks will decrease.  AAC itself can go over 0dB, so AAC encoding won't cause clipping, but if you play the AAC decoded to full-volume into your DAC, your DAC will clip at 0dB.  I've never heard of a case where that slight-clipping was audible, but some people like to normalize to -1 or -2dB before encoding to AAC or MP3. 

And if you're paranoid, you might want to load the AAC file into Audacity to check the peaks after encoding.    Or, you could do a 3-step process...    Encode to AAC and check the peaks.  Then go back to the lossless original, adjust the levels and AAC encode again to hit your target level.     

Quote
Oh and I'm asking to normalize the whole image beause I don't want some calm tracks to sound loud.
If you have separate files, I don't know of a way to normalize as a group...  You'll probably have to check the files one at a time** to find the highest peak and then adjust all of the files by the same amount (normalize "manually").



*Some people worry about inter-sample overs, but there is no inter-sample information in the digital data and there's nothing that prevents the analog-side of your DAC from going over 0dB, and I don't know of any case where there was audible clipping of inter-sample overs.

** I check the peak level in Audacity by running the Amplify effect and noting the default amplification.  Then if I'm just checking, I'll cancel the effect.  Or, SoX has a "stats" command that can check the peak levels.
  • Last Edit: 29 December, 2016, 02:13:55 PM by DVDdoug

Re: Enconding AAC help
Reply #2
http://www.foobar2000.org/components/view/foo_r128norm
You could try and use this plugin for foobar2000. Just add and activate it under "Processing". Many plugins have further configuration options. If you removed "--rate 44100" it would automatically resample to 48 kHz if necessary. But you probably need 44100.

If you use SoX for everything, look out, that you atleast use FDK AAC, because FAAC really sucks at the moment.

Is there a good reason for normalization in this case?
  • Last Edit: 29 December, 2016, 03:24:04 PM by rudolf.gelpke

Re: Enconding AAC help
Reply #3
http://www.foobar2000.org/components/view/foo_r128norm
You could try and use this plugin for foobar2000. Just add and activate it under "Processing". Many plugins have further configuration options. If you removed "--rate 44100" it would automatically resample to 48 kHz if necessary. But you probably need 44100.

If you use SoX for everything, look out, that you atleast use FDK AAC, because FAAC really sucks at the moment.

Is there a good reason for normalization in this case?

yes, I'm using foobar just for AAC encoding, I use sox to resample to 44100 and normalize, I normalize just for playback on my mobile device and at home, after that I delete them and I keep the original files anyways.

Quote
I check in Audacity with Normalizing and adjusting the db to -0.1 and sometimes the waveform amplifies, meaning they were not normalized before. I want to amplify the audio without clipping, what is the correct way to do it?
That's one way to do it.   Audacity also has a Normalize  effect with a couple of additional features/options.  If you're going to normalize in Audacity of course no need to worry about doing it again in SoX or foobar.    Or, you should be able to do the normalizing & encoding with one line in SoX.    (I don't use foobar, so someone else will have to help you with it.) 

Personally, I normalize to 0dB.  Nothing bad happens until you try to go over  0dB.*  However, AAC is lossy, the wave shape will change, some of your peaks will increase and other peaks will decrease.  AAC itself can go over 0dB, so AAC encoding won't cause clipping, but if you play the AAC decoded to full-volume into your DAC, your DAC will clip at 0dB.  I've never heard of a case where that slight-clipping was audible, but some people like to normalize to -1 or -2dB before encoding to AAC or MP3. 

And if you're paranoid, you might want to load the AAC file into Audacity to check the peaks after encoding.    Or, you could do a 3-step process...    Encode to AAC and check the peaks.  Then go back to the lossless original, adjust the levels and AAC encode again to hit your target level.     

Quote
Oh and I'm asking to normalize the whole image beause I don't want some calm tracks to sound loud.
If you have separate files, I don't know of a way to normalize as a group...  You'll probably have to check the files one at a time** to find the highest peak and then adjust all of the files by the same amount (normalize "manually").



*Some people worry about inter-sample overs, but there is no inter-sample information in the digital data and there's nothing that prevents the analog-side of your DAC from going over 0dB, and I don't know of any case where there was audible clipping of inter-sample overs.

** I check the peak level in Audacity by running the Amplify effect and noting the default amplification.  Then if I'm just checking, I'll cancel the effect.  Or, SoX has a "stats" command that can check the peak levels.

yes, I convert all files to one with Foobar converter with original bit rate and sample rate, and then I normalize (if it's not already) and only change sample rate with SoX batch converter to 44.1 kHz since I don't want to add --rate to my CL in foobar for AAC, I'm currently using this code and I'm satisfied with the results. I followed all the guide on qaac documentation, since I'm using FLAC I had to put a .dll on the qaac folder.

Code: [Select]
--gapless-mode 0 --no-smart-padding --no-optimize -V118 -q2 -o %d -


by the way, any recommendation to avoid clipping when converting CD audio to AAC? should I use an extra code or just use Advanced Limiter DSP on foobar?

thanks


  • Kohlrabi
  • [*][*][*][*][*]
  • Global Moderator
Re: Enconding AAC help
Reply #4
by the way, any recommendation to avoid clipping when converting CD audio to AAC? should I use an extra code or just use Advanced Limiter DSP on foobar?
Personally, I normalize to 0dB.  Nothing bad happens until you try to go over  0dB.*  However, AAC is lossy, the wave shape will change, some of your peaks will increase and other peaks will decrease.  AAC itself can go over 0dB, so AAC encoding won't cause clipping, but if you play the AAC decoded to full-volume into your DAC, your DAC will clip at 0dB.  I've never heard of a case where that slight-clipping was audible, but some people like to normalize to -1 or -2dB before encoding to AAC or MP3.
Like DVDdoug said, normalize to -1dB or -2dB to leave a bit of headroom. While the resulting AAC file will not have clipping, when actually decoded your DAC might clip, so a bit of headroom should be enough to avoid that.

It's only audiophile if it's inconvenient.