I've been trying to learn about audio sampling in C++ for past few days. What I learnt was that computer converts analog signal (of sound) and converts it to digital discreet signals and unit called a sample. Also there may be around 40,000 samples taken in a second.

My question is what information do each sample contain. Is it the sound's intensity level at that point, its pressure displacement, or anything else.

In c++, there is a structure "WAVEHDR" which stores the digitized information of each sample converted from analog signal.


What exactly is the information stored in the buffer ('lpdata') corresponding to each sample. I mean, how do I interpret that information?


It depends on the sensor you are using. Some microphones measure pressure, some measure rate of change of pressure, some measure others things.