Basic knowledge of PCM
PCM refers to uncompressed original sound pulse signal data, which is mainly described by sampling rate, sampling format (for example, each sampling point is 8 bits, 16 bits, 32 bits, etc.), and the number of channels.
There are two modes for representing PCM packets in FFmpeg, planer mode and packed mode, so what is the difference between them? Among them, packed is also called interlaced mode, and planer is also called planar mode. The so-called interlaced or plane is the way in which sound signals of different channels are arranged and stored. For example, for a two-channel PCM data, it is expressed in packed mode like this :
Use L to represent the left channel data, and R to represent the right channel data
LRLRLRLRLRLRLRLR
And if it is expressed in laner mode, it looks like this:
use L to represent the left channel data, and use R to represent the right channel data
LLLLLLLL RRRRRRRR
In FFmpeg, the format of packed mode is:
AV_SAMPLE_FMT_U8, ///< unsigned 8 bits