0
votes

I am trying to initialize AAC encoder with the following parameters aac-profile=5, mime=audio/mp4a-latm, bitrate=12000, channel-count=1, sample-rate=8000

But the codec initialization fails with the following error:

06-14 19:17:58.009 6194-6450/? E/SoftAACEncoder2: Unable to initialize encoder for profile / sample-rate / bit-rate / channels
06-14 19:17:58.010 6194-6449/? E/ACodec: [OMX.google.aac.encoder] ERROR(0x80001001)
06-14 19:17:58.010 6194-6449/? E/ACodec: signalError(omxError 0x80001001, internalError -2147483648)
06-14 19:17:58.010 6194-6449/? E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 6

But, when I try to initialize it with sampling rate of 16khz, it works, but the documentation says, the AAC-HE profile supports 8khz sampling rate. Any idea what could be the issue?

1
Try bitrate=16000 or even bitrate=32000... Also what is your bit-depth setting (8bit or 16bit audio)?VC.One
Hi, Thanks for the reply, I tried with 16000, the result is same. I am using 16bit audio.user2067340

1 Answers

1
votes

What documentation says that HE-AAC supports 8 kHz sampling rate? There's also a difference between the standard itself supporting it, and this particular encoder supporting it.

In practice, HE-AAC uses a technique called sideband replication (SBR). This boils down to that the main AAC stream itself is of the half sample rate, and then the higher sample rate is reconstructed on top of this. If you'd encode 8 kHz audio in this way, the main AAC stream would be 4 kHz, and I'm not sure if the encoder actually supports that.

Therefore, HE-AAC mostly makes sense if you have got a high sample rate - it doesn't make much sense to try to use it for a 8 kHz audio stream.