One. Sound production

Sound is produced by the vibration of objects

2. It can be transmitted through air, solid, liquid, etc

3. Sound is heard by vibrating the eardrum and activating the nervous system

Two, auditory range






Three, the three elements of sound

1, tone: the speed of the audio boys > girls > children

2. Volume: the amplitude of vibration

3, timbre: harmonics pleasing to the ear, like melodious, there is no harmonic tone

Four, analog-to-digital conversion

1. Analog signal




Binary square wave



Audio raw data

PCM

WAV PCM + head

Basic concepts of quantization

1. Sample size and how many bits are used to store a sample. Commonly used is 16 bits

2, sampling rate: sampling rate of 8K, 16K, 32K, 44.1K, 48K

3, channel number: mono, double channel, multi-channel

Rate calculation

1. It is very easy to calculate the bit rate of a PCM audio stream, sampling rate * sampling size * number of channels

EG: Sampling rate is 44.1khz, sampling size is 16bit, two-channel PCM encoded WAV, its bit rate is 44.1K*16*2= 1411.2KB /s

The code stream is clearly not working on our network


The way audio is collected

1.Android audio collection

AudioRecoder, MediaRecoder

2. Collect audio on the Ios terminal

AudioUnit

3. Collect audio on Windows

FFmpeg audio collection can be used

1. Run commands

Ffmpeg-f avfoundation -i “:0″ out.wav //”:0″ for audio

ffplay out.wav

2. Use API

Subsequent interpretation