I am trying to encode a WAV file (44.1 kHz, stereo) to AAC Low Delay and Enhanced Low Delay format using the Fraunhoffer FDK AAC library
I am using the encoder given here
The encoder is in the aac-enc.c file. Changing the value to the aot parameter determines which AAC encoding format will be used. I set the values of aot to one of the values of the AUDIO_OBJECT_TYPE enum, which is defined in /libSYS/include/FDK_audio.h at line 159. For AAC-LD and ELD I choose AOT_ER_AAC_LD (23) and AOT_ER_AAC_ELD (39) respectively. I keep everything else in aac-enc.c unchanged, except the aot value.
Doing this, I get the error AACENC_INIT_TP_ERROR (enum defined in /libAACenc/include/aacenc_lib.hline 1031) afteraacEncEncode()` function and the decoding stops. The aac-enc.c program works if I choose other AAC formats like AAC LC or HE-AAC.
Why isn't this working for AAC-LD and ELD? Are there any other parameters that I have to change?
That's because ADIF and ADTS is only supported for AOT_AAC_LC:
You have to change AACENC_TRANSMUX parameter to use LOAS or LATM: