Click here to Skip to main content
15,880,364 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Playing a .wav file using soundInstance object of XNA framework. Volume of sound i.e. soundInstance.Volume lies between 0f -1f. I want to Convert these values to corresponding dB-SPL. Please help me. I am not getting it.
Posted
Comments
Ron Beyer 19-Jul-13 11:19am    
I don't believe this is possible. dB-SPL depends greatly on the speakers attached to the system. I can have my volume turned all the way up in the control panel, and my speaker volume all the way down, etc. Think the way car audio competitions work, dB is dependent greatly upon the speakers/amps, not necessarily the head unit.
OriginalGriff 19-Jul-13 11:20am    
This should be posted as the solution I believe.
It's what I was going to say, but more elegantly put!
Ron Beyer 19-Jul-13 11:23am    
Done! :)
Jason Gleim 19-Jul-13 14:59pm    
Technically speaking, the line output of a sound card is 1 volt peak-to-peak. Assuming the D/A (digital to analog converter) is perfectly linear, then your internal setting would roughly equate to a proportional output voltage. However, in practice, there is no such thing as a perfectly linear D/A and measuring values on transient sound waveforms can be an exercise in futility. That is why averaging functions like RMS are usually applied in these cases.

But as the others have noted, there is an amp between the output and the speakers that really determines the SPL. (Sound pressure level) I could set the output volume at 20% and still generate 100dB SPL at 10ft with proper amps and speakers.

I don't believe this is possible. dB-SPL depends greatly on the speakers attached to the system. I can have my volume turned all the way up in the control panel, and my speaker volume all the way down, etc. Think the way car audio competitions work, dB is dependent greatly upon the speakers/amps, not necessarily the head unit.
 
Share this answer
 
Comments
OriginalGriff 19-Jul-13 11:37am    
:thumbsup:
Sergey Alexandrovich Kryukov 19-Jul-13 16:32pm    
Correct, a 5. Perhaps you should have explained that dB is always a relative measure. (I added a link in my answer.)
—SA
Espen Harlinn 19-Jul-13 19:33pm    
5'ed!
mansurmojom 20-Jul-13 11:26am    
Ron Beyer, suppose I have a headset which typically supports 100 dB at 1 kHz, 1 mW. How I have to cater this for measurement of dB-SPL.
You need to understand that dB is relative measure: http://en.wikipedia.org/wiki/Decibel[^].

—SA
 
Share this answer
 
Comments
Espen Harlinn 19-Jul-13 19:35pm    
Certainly useful :-)
Sergey Alexandrovich Kryukov 19-Jul-13 20:27pm    
Thank you, Espen.
—SA
mansurmojom 20-Jul-13 11:23am    
Thanks Sergey Alexandrovich Kryukov!
Sergey Alexandrovich Kryukov 20-Jul-13 22:07pm    
You are welcome. Are you going to accept this answer formally, too?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900