I’m not a CS graduate or anything. I am a self-taught developer. This is what I’ve been wondering quite a while now.
I kinda know how images work. Yes, the format specifications might differ. A PNG file and a JPG file are different about how they *store* the image data. However, at the end of the day, images are the horizontal and vertical formation of pixels on a screen.
Yet, I do not know what a “sound” is. Images have a unit like “pixel”, what is the unit of sound?
Please note that I’m talking about “sound” as data, not as a physical event.
In: Technology
So when we’re talking about digital audio, we still have to talk about sound as physical event because it’s important inasmuch as we need to know the mechanism that translates a pressure wave in the air into digital data works.
To record audio, a microphone (I won’t go into the details of how a microphone works because it isn’t relevant here) converts the pressure waves that are sound into fluctuations in electrical current. This fluctuating level of current is measured by a device called an analog-to-digital converter which samples the current many times a second (the most common standard is 44.1khz, or 44,100 times per second) and creates a number representing that electrical signal (which itself represents the frequency and amplitude of the sound wave) which can be read by a program. These numbers are ultimately stored in a file (like all things on computers, they are ultimate stored as as binary, but the file itself can use all available digits), so you might have a single sample that says “234325601” or something like that.
To play back the sound out of speakers, the process works in reverse. A program reads those numbers off of wherever the file was stored and tells a called a digital-to-analog converter to generate a strong or weak current on a wire depending on the number the program tells it to generate. Speakers then convert that electrical current into sound.
To get to the core of your question, you can say the “unit” of audio is the number that represents one sample, so if the sample rate is 44.1khz, there are 44,100 numbers, and thus 44,100 “units” of digital data per second of audio, ignoring compression.
Latest Answers