Algorithm for Wave Samples to Decibels - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Algorithm for Wave Samples to Decibels

Can anyone point me in the right direction? I'm trying to determine how

waveform samples translate into decibels. I've seen so many recorders

that display the decibel level and I need to know the formula that is used.

I have a solid understanding of wave file formats as I've written a wave file player and


Thanks in advance,

Christopher Hodges

Author of MIDI Station Sequencer for OS/2



  • Hi Christopher,

    Just wondering that there was no answer from sound programmers for such a simple question.

    (I am not prof).

    If you use unsigned integer for digital amplitude representation (for 16-bit sound) try to calculate it as following:

    dblev = 6*(float)log2((float)amplitude/65536);

    Now maybe someone could give me a glue how to get

    audio simultaneous playback capability using Win API?



Sign In or Register to comment.