Can you calculate a 44.1k wav streams volume by looking atthe integers

I've noticed that the difference between successive integers affects the volume the most, for example, if the first integer is 4000 and then next integer is -4000, then this is an 8000 difference. This 8000 difference is louder than say a 4000 difference.

At first, I thought, ok this difference is the volume, but it is more complicated than this. For example, if an 8000 for 1/100 second is one particular volume, where the 8000 for 1/1000 second is much less volume. My point is that even though I can find differences in the wav file of say 20000, they only exist for very small amounts of time and create much less volume than the 20000 difference would if it were longer.

Is there an algorithm to look at this and estimate the volume?




  • hi

    what you described is the 'peak'-performance of a sound, but our ear does not judge volume that way: it rather follows the 'energy' of the signal. This should explain why a 10 ms signal appears louder as a 1 ms signal: there is more area unther the waveform: more energy.

    A common way to express volume is tho measure the RMS of a signal: Root Mean Square. It explains itself: take the square of the sample values, add them, divide them by the number of samples in the equation, and take the root of it.

    I hope this explanation was clear helpfull to you


Sign In or Register to comment.

Howdy, Stranger!

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


In this Discussion