Audio files very low quality when exporting as m4a

I was editing an m4a file, and when i exported it as m4a, the audio quality of the output file was really bad, a lot worse than the original file. The windows explorer properties menu says the original file is 320 kbps and in the export menu, I also selected 320 kbps. The output file also shows as 320 kbps in windows properties, however as I said, the quality is very obviously a lot worse than the original file when listening.

1 Like

That’s odd… M4A/AAC is supposed to be immune to “accumulated compression damage”. (MP3 is one of the worst with repeated encoding, but even with MP3 one extra generation of MP3 encoding shouldn’t make it “terrible”.)

What kind of editing/processing did you do?

All I did was cut part of the audio, and add a fade out at the end.

I have no explanation.

There are a few M4A editors that can do simple editing like cutting/fading without decompressing but I don’t have one so you’ll have to search. MP3directCut (which I do have) is supposed to handle M4A (without decoding) if you add a DLL but I couldn’t get it to work.

could it have something to do with the file itself? since i know the file was originally an mp3, and was changed to m4a by someone else

Hello, I need to bring this issue up again. I have the same problem and I have tried everything, but still the problem persist. My input file is uncompressed raw recording. To demonstrate the problem, I just import this file into Audacity (I am using v2.4.2) and without any editing I just export as m4a(aac). No matter what quality I choose, the result is bad. Really bad… Please have a look at spectrogram comparison:
2021-12-02 12_20_48-Samples.png
What am I doing wrong?

The first thing that I notice is the non-standard colors, indicating that you are using a modified version of Audacity. What modifications does your version have?

Which version of FFmpeg are you using?

The colors were changed in the color palette here: “%appdata%\audacity\Theme\ImageCache.png”
I hope this should not affect exporting quality.

Version of ffmpeg is v2.2.2. This library was installed exactly according to the audacity manual instructions. In the Preferences I can see this version numbers: F(55.33.100),C(55.52.102),U(52.66.100)

Also I have just now discovered that I can export good/expected quality only via Custom FFmpeg Export. I have to select Show All Codecs and then select aac. Maybe this information can be helpful for you. Still I would like to know, why the standard option for AAC export is not working.

Update: I have found out that I can export aac correctly also when using this cmd: ffmpeg -i - -strict -2 -c:a aac “%f”
It looks like the experimental codec aac does the job properly, but maybe it is not used when using standard M4A (AAC) option. Instead there is used probably libvo_aacenc. But with this codec I cannot get good results.
Also I cannot use custom present for mp4+aac in dialog Configure custom FFmpeg options. Every time I load such user present, it switches codec from aac back to the libvo_aacenc. Why I can use combination mp4+aac and I can save it as present, but I cannot use it, this is mystery for me…

1 Like

I’m facing this problem regardless of the format I use as long as I see FFMPEG within brackets at the end of the chosen format description. Instead, at first I tried forcing my Audacity 2.2.2. to use a later version of ffmpeg for audacity but that plan fell apart. Somehow, I could sorta pinpoint what was causing it when using Custom FFMPEG Export dialog. The loss of quality was only heard while using any codec with libvo_aacenc. I tried AAC with ADTS and MP4 codecs without daring to click on libvo_aacenc and I was saved. I did a phase inversion test on them too.
ffmpeg.png

I just tested on W10 with 3.4.2 and the latest alpha test build I have for the upcoming 3.3.0

I imported a known WAV file that I have (and use often for testing) and then exported it as anM4A(AAC) at Audacity’s default setting of 160 kbps.

The resulting AAC file sounded absolutely fine to me with good sound quality when I played it back using the Groove Music player.

Though I note that the resultant AAC file was exported at 196kbps NOT the 160kbps specified in the otrput dialog. In earlier qualities the AAC quality level was set with a slider and I logged this bug back in 2021
The slider setting value for AAC/MP4 export is not honored by Audacity - and the slider cannot make precise settings #1818
https://github.com/audacity/audacity/issues/1818
The bug was “fixed” (and closed) by removing the slider and replacing it with the current numerical kbps setting - but it looks like an issue remains.

As an aside
I would add that when I converted my vinyl LPs and single for use on my iPods, I exported as WAV from Audacity and used iTunes to make the WAV to AAC conversion - and I converted to greater that 160kbps (using initially 192 when I had a smaller iPod and later 256kbps when I got larger disk iPods).

Peter

I retested the findings I had last year with old bug and I found the the requested kbps traet is still mostly not honored properly - so I logged afresh bug for this:

M4A(AAC) Export does not honor the user’s quality settings in the export dialog #4309
https://github.com/audacity/audacity/issues/4309

Peter.

1 Like