Digital Sound

A human listens to Mozart's Violin Concerto No. 3. Either that or it's "Ace of Spades" by Motörhead.
Let me start off by saying, “Don’t do any of this yourself.” This is one of those topics where there are countless libraries already written for you with well-designed and well-tested code to do everything you want and more. It’s presented here because it fits criterion #1 for why you’d re-invent the wheel: you’re doing it because you want to learn more about it. So there you have it!
There are many ways to represent sound digitally, but let’s start with sound in real life. The situation we have is that a bunch of alternating high- and low-pressure waves are moving through the air like ripples in a pond. They reach your ear and push your eardrum in and out. The eardrum’s connected to the what’s-it, the what’s-it’s connected to the thing-a-ma-bob, and the thing-a-ma-bob is connected to your brain, which fools you into believing you’re hearing something, depending on how your eardrum is moving.