Audio Basics Explained PART 2

Sample Bits (sample bits, aka sample precision, quantization level, sample size, quantized data bits): The range of data that each sample point can represent.

The number of sampling bits is usually 8 or 16. The larger the number of sampling bits, the more delicate the change of sound that can be recorded, and the larger the corresponding amount of data. 8 bit word length quantization (low quality) and 16 bit word length quantization (high quality), 16 bits is the most common sampling precision.
“Sample rate” and “sample bits” are the two most basic elements of sound digitization, which are equivalent to screen size
(for example, 800*600) and the color resolution (for example, 24 bits) in the video.
Number of channels (or number of channels): The number of channels refers to the number of speakers that support different sounds, it is one of the important indicators to measure audio equipment.
The number of channels for mono is 1 channel; the number of channels for channels
dual is 2 channels; the number of channels for
stereo channels is 2 channels by default; the number of channels for
stereo channels (4 channels) for 4 channels.
Frame (Frame): A frame records a sound unit whose duration is the product of the sample duration (number of samples) and the number of channels.
Period (Period Size): The number of frames required for an audio device to process at one time. Data access and audio data storage of the audio device are based on this unit. The hardware buffered transfer unit, which completes the transfer of so many sample frames, will return an interrupt.
insert image description here
Periods: How many hardware transfer interrupts it takes for the transfer to complete one application buffer.
Buffer Bytes: The number of bytes in an application buffer, the size of the DMA buffer.
Because the buffer size is set by the application, it can be large or small. If it is too large, the transmission delay will be too large, so it is fragmented and the concept of a period is proposed. Overflow, when recording, the data is full and the application does not have time to grab it; underflow, you need data to play and the application does not have time to write the data
Interleaved Mode: The way digital audio signals are stored. The data is stored in consecutive frames, that is, the left channel and right channel samples of frame 1 are recorded first, and then the recording of frame 2 is started…
Non-interlaced mode: The left channel samples of all frames in a cycle are recorded first, then all the right channel samples are recorded.
Quantization: The process of representing the amplitude of the discrete signal after sampling with binary numbers is called quantization. (Quantification in daily life is to set a range or interval, and then look at the acquired data collected within this condition.)
PCM: PCM (Pulse Code Modulation), that is, pulse code modulation, sound sampling and quantization without any encoding and compression processing.
PCM data is the most primitive lossless audio data, so although PCM data has excellent sound quality, it is bulky.
To solve this problem, a series of audio formats have been successively born. These audio formats use different methods to
compress audio data Compression (ALAC, APE, FLAC) and lossy compression (MP3, AAC, OGG, WMA) are available.
Encoding: The sampled and quantized signal is not yet a digital signal, it must be converted into a digitally encoded pulse, a process called encoding. The digital audio signal is the binary sequence formed after sampling, quantizing, and encoding the analog audio.
Bit rate: (also known as bit rate, bit rate) refers to the amount of information that can pass through a data stream per second, which represents the quality of compression. For example, common MP3 bit rates are 128 kbit/s, 160 kbit/s, 320 kbit/s, etc. The higher the rate, the better the sound quality. Data in MP3 consists of ID3 and audio data. ID3 is used to store common information such as song title, singer, album and track.