0

I sampled the raw PCM data from the device, encoded it through libfaac to an audio file in ".aac" format(ADTS format), and when I sampled it in 16KHZ or 41KHZ the encoded ".aac" file played faster than normal. What's the reason?

The parameter configuration is as follows:

    pConfiguration->inputFormat = FAAC_INPUT_16BIT;
    pConfiguration->outputFormat = 1; /*0 - raw; 1 - ADTS*/
    pConfiguration->bitRate = 16000; 
    pConfiguration->useTns = 0;
    pConfiguration->allowMidside = 1;
    pConfiguration->shortctl = SHORTCTL_NORMAL;
    pConfiguration->aacObjectType = LOW;
    pConfiguration->mpegVersion = MPEG4;
    //pConfiguration->useLfe = 1;
YuanDa.Yu
  • 127
  • 7

1 Answers1

0

The problem has been solved:

I lost the raw PCM data of some data frame, I use a HISI3516EV100 processor, using HISI SDK, the problem was I configuration parameters of PCM data, sampling rate in the case of a 16000HZ, PCM data frame sampling points set to 160 sampling/frame, this will cause produce 16000/160 = 100 frames per second, the frame rate is too high, each PCM data frame I need to call the processing function for AAC encoding, it will cause a lot of function in the stack,Almost 1000/100 = 10ms needs to complete one frame of PCM data to call the AAC encoding interface, the frequency is too high, and the libfaac library is a little CPU consumption, resulting in lost frames (the original PCM data frame is partially lost), so that in the case of partial loss of the original PCM data, the encoded AAC data will play faster than usual.

Solution: lengthen the frame length of PCM frame to 160samples/frame--->480samples/frame

YuanDa.Yu
  • 127
  • 7