Direct sound samples

Started by
4 comments, last by Sneftel 18 years, 7 months ago
What physical value does the samples of the directSoundBuffer represent? What does the 8 bit and the 16 bit of the sound data represent? Is it decibels? How does the 8 bit and 16 bit translate into decibels?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Advertisement
Sound data is made up of a few components

Channels: This is how many separate channels of sounds are stored in one sample. Common values are 1 and 2 for mono and stereo sound respectivly

Samples: This refers to how many samples it will take to play one second of audio. Common values are 8000, 11025, 44100

Bits Per Sample: This should really be Bits Per Channel as each channel consists of this many bits. Common values are 8 and 16 bit.


the number of bytes it takes to store audio can be calculated as

channels * samples * (bitspersample / 8) * timeinseconds


an 8 bit sample of sound consists of a value from -127 and 128 indicating the amplitude of the wave data. 0 being the neutral position of the wave form

an 16 bit sample of sound consists of a value from 0 to 65535 where 32768 is the neutral position of the wave form

as you can see the 16 bit sample has a much finer resolution of sound and therefor produces a smoother approximation of the change in amplitude of the wave form producing a clearer, less grainy sound.

also having a high samples per second provides rate a much more acurrate representation of the waveform providing a truer reproduction when being played back.

a decibel is a unit of measurement measuring the loudness of sound.
8 and 16 bits represent the resolution of the sample. A sample is a value that is taken from an analog signal and converted to an integer value that is the digital representation of that amplitude at any given point in time. EDIT: Changed frequency to amplitude, losing my mind. The frequency is inherently driven by the changes in amplitude. Sorry!

If you're interested, there is a lot more information on the web about digital audio waveform sampling.

EDIT: Ximmer beat me to it. Also, decibels are represented in the logarithmic domain. If you want to double the loudness, you'll increase about 10 dB.
Chris ByersMicrosoft DirectX MVP - 2005
Quote:Original post by Supernat02
8 and 16 bits represent the resolution of the sample. A sample is a value that is taken from a range of frequency in an analog signal and converted to an integer value that is the digital representation of that frequency at any given point in time.

Wait, what? This is PCM data. A "sample" is total amplitude at a given time, not a given frequency component.
Ok, but this is the digital value of the wave.
Doesnt the digital value represent some physical attributes?
Like, if you would store the length of a pencil in the computer, you would store it perhaps in centimeters and its physical attribute would be distance.
Doesnt the digital value of the wave have a physical dimention?
Something like air pressure or air density? or some other physical attribute?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Quote:Original post by The C modest god
Ok, but this is the digital value of the wave.
Doesnt the digital value represent some physical attributes?
Like, if you would store the length of a pencil in the computer, you would store it perhaps in centimeters and its physical attribute would be distance.
Doesnt the digital value of the wave have a physical dimention?
Something like air pressure or air density? or some other physical attribute?

Speaker cone extension. Assuming a signed representation, +MAX represents the speaker cone pushed all the way forwards, and -MAX represents the speaker cone pulled all the way backwards.

This topic is closed to new replies.

Advertisement