Theres also the equal loudness contour, which tells us that we hear an increase in volume differently accourding to the frequency of the sound, so each frequency has a different "double volume" level.Īll in all, it's complicated and I'm not pretending to understand all of it and I certainly oversimplified parts of it, but that's what I can tell you. Therefore, the louder your initial sound is, the even louder your "double" volume sound has to be. The Weber-Fechner law says that the more you increase a "signal", the less apparent an identical difference is (adding 5 dots to a starting 10 dots is more apparent than adding 5 dots to a starting 100). If you try to measure subjectively if a sound sounds twice as loud as an other, you have a bunch of other factors that come into play. That's because some of the sound from each guitar cancels out the other guitar, unlike a duplicate signal, which has no phase cancellation. What's more is that, unlike a 6dB increase in "signal" you might expect, you actually get less. If you have 2 guitarists playing together, you could say that it is twice as loud, but you don't necessarily hear it that way. What makes it difficult to comprehend are the multiple effects that come into play. Here are some properties you can use about sound:ĭuplicating a signal and hearing both together results in a ~6dB increase.Īdding 10dB increases the power of the wave by 10x.Īdding 20dB increases the amplitude by 10x. It's more useful to think in different terms when it comes to volume, like a negative decibel scale in digital audio, in reference to a 0 dB signal. The above function would return 100 for dB=0, 50 for dB=-6, 25 for dB=-12, etc, which I believe is what you were asking for in the first place.Reason why it's confusing is that there's actually much more to it than you think. Generally negative dB means smaller than reference_value (that's why people often use the max amplitude for that one) Just don't forget that dB must be negative. The 'pow(10,dB/20)' comes from solving : dB = 20*log( pctg ) for pctg, and multiply it by an extra 100 to turn it into a percentage. Since each unit is 1/100 of a dB, divide the dsound value by 100 to turn it into decibels, call it e.g. Personally, I would suggest you use the following: Generally when you double the sound's amplitude, the ratio in decibels is increased by +6dB (which is 20*log(2)), and when you halven the value the ratio is decreased by 6dB (-6=20*log(.5))(this is why audio most apps have reference lines in their graphs at -6dB,-12dB etc.) In most audio edit applications, programmers use as reference_value the maximum value for an audio sample, because this is the easiest approach when you want to turn dB into amplitude percentage. I haven't worked with directSound to be honest, but the SPL (sound pressure level) ratio in decibels is given by 20*log(actual_value/reference_value), where the logarithm is to base 10. DirectSound does not support amplification. The value DSBVOLUME_MIN indicates an audio volume attenuated by 100 dB, which, for all practical purposes, is silence. The value DSBVOLUME_MAX represents the original, unadjusted volume of the stream. These values are defined in Dsound.h as 0 and –10,000 respectively. The following is from 'DirectX C++ Documentation' for IDirectSoundBuffer8::SetVolume(LONG lVolume)Īllowable values are between DSBVOLUME_MAX (no attenuation) and DSBVOLUME_MIN (silence).
So you can see there is a very large range of sounds. So if you had 50 dB you'd have 2 pascales. Giving a range of practically (2000-2e-4) equals approximately. So let's say your range is 10 to 80 dB(you'll want to find out what you believe is reasonable) then you'd solve for I for both of these to give you the 'range' of pressures. Where Io is the Threshold of Hearing, I is the current pressure, and dB is the decibel amount. Which is 2 x 10e-5 pascals where a pascal is a measurement of pressure(which makes sense cause that's all sound is, a change in pressure) A sound 1,000 times more powerful than near total silence is 30 dB, 40 dB and so on. A sound 100 times more powerful than near total silence is 20 dB. The equation for getting the dB is dependant on what is defined as the Threshold of Hearing for humans. On the decibel scale, the quietest audible sound (perceived near total silence) is 0 dB. So you first have to define a range of acceptable values, (say between 10 and 80 dB or something you feel is realistic for the situation) That is you can theoretically have like -10,000 dB or 1,000,000 dB. Well the decibel scale isn't upper or even LOWER bound.