SFML community forums
Help => Audio => Topic started by: Felix91 on July 10, 2017, 11:18:42 pm
-
Sorry for my bad english.
I'm writing a little Voice Chat program and i'm nearly done. I already found out that the highest value of a short Sample Array describes how loud the sound is. But i want to know how i can convert this in volume. Does anyone know that?
-
It would depend on what you mean by volume (doesn't it technically depend on the listener's amplification?) and which scale (linear ratio of maximum, RMS, decibels, for examples) you wish to use to describe it.
You've already stated that the highest value (peak) of a short section can give an indication of how "loud" it is. You might want to compare its distance to the average value to offset any off-centre waves.
There is easy-to-find information on the internet about calculating RMS and DB reduction.