/* * unsigned long nsamplerate, //sample rate in bps* unsigned long nchannels, //channel, 1 mono, 2 for dual channel * unsigned long &samplesinput, //reference, gets the original data length that should be received each time the encoding is called * unsigned long & Maxbytesoutput//Pass reference, get the maximum length of AAC data generated each time the code is called * /faacencopen(samplerate , channels, &samplesinput, &maxbytesoutput);
The original data length that should be received by the known sample rate and channel first for each AAC encoding before using AAC encoding is the third parameter in the code above Samplesinput
There is also the maximum length of the AAC data output per encoding, which is the fourth parameter in the above code Maxbytesoutput
Audio encoding:
int Faacencencode out, enc_size);
In the true audio AAC encoding, the interface uses pcm_buffer[] that is, the raw data entered is equal to the length of the original data received before each AAC encoding should be taken, that is, the Samplesinput
The enc_size is the maximum length of the AAC data that is obtained on each encoding, which is the maxbytesoutput obtained above.
Above out[] size is the length of maxbytesoutput
Note: Only the original PCM data is required for audio encoding, and those timestamps do not have much to do with true AAC encoding. The timestamp may be next to the audio AAC encoded data.
Analysis of audio AAC coding