Introduction to WAV
作者:罗上文,微信:Loken1,公众号:FFmpeg弦外之音
As mentioned earlier, if we forget a PCM file's sample format, channel count, or sample rate, we cannot play it correctly because PCM contains only raw data and stores none of this additional information.
Suppose we want to save raw audio locally (raw PCM needs no decoding, which saves processing power), but do not want to remember all these parameters. What should we do?
This is where the WAV file format is useful.
WAV stands for Waveform Audio File Format. It first appeared in Windows 3.1. It can store compressed data as well as uncompressed PCM data.
We can mux a PCM file into WAV with FFmpeg:
ffmpeg -ar 48000 -ac 2 -f s16le -i juren-10s.pcm -c:v copy juren-10s.wav
The sample format, channel count, and sample rate are written into juren-10s.wav. Because little data is added, the two files are almost the same size:

When playing a WAV file, we no longer need to specify the sample rate manually. We can use:
ffplay -i juren-10s.wav