Example #1
0
 private byte[] DecMultiAAC(byte[] buffer)
 {
     AAC_ADTS[] aacs = null;
     try
     {
         aacs = AAC_ADTS.GetMultiAAC(buffer);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         aacs = null;
     }
     if (aacs != null)
     {
         if (aacs.Length == 1)
         {
             return(DecAAC(buffer));
         }
         else
         {
             return(DecMultiAAC(aacs));
         }
     }
     else
     {
         return(null);
     }
 }
Example #2
0
        private void Init(byte[] buffer)
        {
            if (!_inited)
            {
                AAC_ADTS[] adtss = AAC_ADTS.GetMultiAAC(buffer);

                if (adtss != null)
                {
                    int channels  = adtss[0].MPEG_4_Channel_Configuration;
                    int frequency = adtss[0].Frequency;
                    //_aac = new FaadImp();
                    _aac    = new FFImp(AVCodecCfg.CreateAudio(channels, frequency, (int)AVCode.CODEC_ID_AAC), true, false);
                    _inited = true;
                }
            }
        }