How to correctly configure AAC ADTS header to support AAC ELD in Android. I am able to configure for LC and Main.
As per the article below
https://wiki.multimedia.cx/index.php?title=ADTS
Profile take only two bits ( E 2 profile, the MPEG-4 Audio Object Type minus 1) but for profile value for AACObjectELD is 39 ie: 0010 0110
private void addADTStoPacket(byte[] packet, int packetLen) {
int profile = 39; // 2 - AAC LC, 39 = MediaCodecInfo.CodecProfileLevel.AACObjectELD;
int freqIdx = 8; // 4 44.1KHz 8 16KHZ
int chanCfg = 2; //2 channel
// fill in ADTS data
packet[0] = (byte)0xFF;
packet[1] = (byte)0xF1;
packet[2] = (byte)(((profile-1)<<6) + (freqIdx<<2) +(chanCfg>>2));
packet[3] = (byte)(((chanCfg&3)<<6) + (packetLen>>11));
packet[4] = (byte)((packetLen&0x7FF) >> 3);
packet[5] = (byte)(((packetLen&7)<<5) + 0x1F);
packet[6] = (byte)0xFC;
}
Kindly request your help.
Thanks in advance
Joseph