Jump to content
  • Advertisement
Sign in to follow this  
The C modest god

Direct sound samples

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!