AAC ADTS for AACObject ELD packets
<p>How to correctly configure <strong>AAC ADTS header to support AAC ELD in Android</strong>. I am able to configure for LC and Main.  </p>

<p>As per the article below<br>
<a href="https://wiki.multimedia.cx/index.php?title=ADTS" rel="nofollow">https://wiki.multimedia.cx/index.php?title=ADTS</a></p>

<p>Profile take only two bits ( E  2   profile, the MPEG-4 Audio Object Type minus 1) but for profile value for AACObjectELD is <strong>39 ie: 0010 0110</strong></p>

<pre><code>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)&lt;&lt;6) + (freqIdx&lt;&lt;2) +(chanCfg&gt;&gt;2));
    packet[3] = (byte)(((chanCfg&amp;3)&lt;&lt;6) + (packetLen&gt;&gt;11));
    packet[4] = (byte)((packetLen&amp;0x7FF) &gt;&gt; 3);
    packet[5] = (byte)(((packetLen&amp;7)&lt;&lt;5) + 0x1F);
    packet[6] = (byte)0xFC;
}
</code></pre>

<p>Kindly request your help.</p>

<p>Thanks in advance<br>
Joseph</p>