Can't open audio codec "aac" (0x11a) error

I’m getting this error when trying to export an mp3 file to AAC format.

Can’t open audio codec “aac” (0x11a)
The Codec reported an invalid parameter (EINVAL)

I guess that that error is coming from FFMPEG, since I also get this from Audacity

{
    "timestamp": 1643913267,
    "event_id": "04d603b9b78e31449d28ec0d085f8cbe",
    "platform": "native",
    "release": "audacity@3.1.2",
    "contexts": {
        "os": {
            "type": "os",
            "name": "Windows",
            "version": "10.0.19044"
        }
    },
    "exception": {
        "values": [
            {
                "type": "Warning",
                "value": "Unable to export.\nError FFmpeg:1008",
                "mechanism": {
                    "type": "runtime_error",
                    "handled": false
                }
            }
        ]
    }
}

And this is from the Diagnostic log

13:47:38: Error: File 'D:\Iens Files\Iens Music\Ringtones\IPhone\I Feel Lucky.m4a' couldn't be removed (error 32: The process cannot access the file because it is being used by another process.)
13:48:39: Error: Failed to load shared library 'avformat-58.dll' (error 126: The specified module could not be found.)
13:48:39: Error: Failed to load avformat-58.dll (error 5: Access is denied.)
13:48:39: Error: Failed to load shared library 'avformat-57.dll' (error 126: The specified module could not be found.)
13:48:39: Error: Failed to load avformat-57.dll (error 5: Access is denied.)
13:48:39: Error: Couldn't find symbol 'avio_context_free' in a dynamic library (error 127: The specified procedure could not be found.)
13:48:39: Error: Couldn't find symbol 'av_packet_alloc' in a dynamic library (error 127: The specified procedure could not be found.)
13:48:39: Error: Couldn't find symbol 'av_packet_free' in a dynamic library (error 127: The specified procedure could not be found.)
13:48:39: Error: Couldn't find symbol 'avcodec_free_context' in a dynamic library (error 127: The specified procedure could not be found.)
13:48:51: [aac @ 000001BC6B649CE0] Too many bits per frame requested

I’ve tried on 2 computers (both Win10 64bit) with Audacity 3.1.3, and on one of them with 3.1.2 as well. I’ve tried with a few mp3 files, and also a wav file.

Conversion to an AC3 file works.


Anyone have any ideas what I might be doing wrong?

I don’t know what’s going-wrong but as a work-around you can convert to AAC (aka M4A or MP4) with [u]Kabuu Audio Converter[/u]. And if you’re just converting without editing it’s a lot easier.

@tony556 Thank you for anticipating my needs by one day. I am impressed! :smiley:
Doug: I have installed Kabuu and am presented with the options
Untitled1.png
Please, Which output format should I chose?

And to pre-empt your question:-
I am recording a track on my smart phone (which records in AAC) so that I can import a set of recordings of spoken text into a single Audacity clip=track for purposes of demonstrating and testing the “Noise Reduction" command in Win10/Audacity 3.1.3

To record benchmark spoken text against different “noise” backgrounds I will play back the AAC from the phone - hence always using the same source of audio waves - against different background noises, and record them on the laptop. As a human I cannot guarantee the same voice, even one minute later, but my smartphone can do that.

I don’t need to convert these AAC files today - I just play them on my smartphone while facing the phone speaker towards the laptop microphone - but those AAC files contain noise that could be removed - more benchmark data - and it seems to me that I can have a larger sample of the same text if, as well, I import my AAC files into Audacity.
(a) Until three weeks ago I used Audacity in MP3 format
(b) Then I learned that WAV was better.
(c) Now I hear people recommend FLAC

Both WAV and FLAC are available through Kabuu, plus some others.

I am not aiming a studio-quality output here, but something amenable to mentors in the Audacity forums, especially the business of helping users to understand “Noise Reduction" command in Win10/Audacity 3.1.3
Thanks
Chris

Please, Which output format should I chose?

AAC = Advanced Audio Coding (m4a)

or purposes of demonstrating and testing the “Noise Reduction"…

… against different “noise” backgrounds I will play back the AAC from the phone - hence always using the same source of audio waves - against different background noises, and record them on the laptop.

You can experiment but noise reduction works best when you have a low-level background hiss or hum, etc. If the noise is bad, “the cure can be worse than the disease.” It works best when you don’t really need it. :frowning:

(b) Then I learned that WAV was better.
(c) Now I hear people recommend FLAC

MP3 & AAC are both lossy compression. Data is thrown-away to make a smaller file.

AAC is supposed to be better, and unlike MP3 “damage” doesn’t accumulate with multiple generations of re-compression - When you open a compressed file in Audacity (or any regular audio editor) it gets decompressed. If you re-export as a lossy format you are going through another generation of lossy compression.

Ideally, you should work in a lossless format and if you want MP3 or AAC, compress ONCE as the last step. But since your phone records in AAC you should try to minimize the number of times it’s re-compressed.

Note that the loss happens during compression. No additional damage happens during decompression and it gets decompressed when you play it anyway.

WAV is uncompressed (so lossless). But, you can make a low-quality WAV (such as 8-bits/8kHz, etc.).

FLAC is lossless compression and it will (usually) compress a WAV to about half the size.
ALAC is Apple’s version of lossless audio compression. If you have an iPhone ALAC may be a better choice.

But of course, you don’t gain quality if you convert from lossy-to-lossless… The data has already been lost and you just make a bigger file…

Dhanks for the answer, DVDdoug. Not ideal, but it works!

TLDR; Change the Project Rate to 44100Hz before exporting as aac.

I just installed the latest audacity and ffmpeg. I have encountered the same problem. I was converting some of my ogg file format ringtones and notifications for iphone. Export audio aac works for some files, but failed for most of what I had. I know for a fact that my ogg files were created with an older audacity. I looked at the audio files to see if there was anything in common which might highlight the cause of the bug. What I observed is that files with a sampling rates of 44100Hz and 48000Hz exported fine. The files with other sampling rates (22050Hz, 11025Hz in my case) would not export to aac. When I changed the Project Rate to 44100Hz before exporting, the files export no problem. Not sure if it is a bug or a limitation of ffmpeg.

Works fine for me on Linux, so it’s not an intrinsic problem in FFmpeg.

I just tried exporting to AAC in v3.2.1 and got this same error.
Tried again with v2.0.4 and it worked fine with no errors.

I just Generated a 1-minute noise file and had no difficulties exporting to M4A (AAC).

Running Audacity 3.2.1 on a Windows 10 machine.

Got this same error: “Can’t open audio codec “aac” (0x11a)”

Steps:
1.) Highlighted a small (10s) section of my fairly long project file (4hrs 20min).
2.) File > Export > highlighted audio
3.) Save as type: “M4A (AAC) Files (FFmpeg)” Quality: 160 kbps (default)

Error pops up and this additional text included: “The codec reported an invalid parameter (EINVAL)”