0
0

Hi,

What would be the best way to implement a decibel meter, a rectangle/beam that shows the "overall volume" of all playing sounds? Should I use getSpectrum() as in dsppluginviewer example?

The problem is though that rather than a spectrum I would like to have a single value. Would that then be the average or a peak value of those got from getSpectrum()? Or should I use some totally different method?

Thanks!

  • You must to post comments
0
0

getspectrum is a bit expensive, i would recommend getWaveData instead.
You pass through the wavedata and keep the maximum absolute value as your peak value.

  • You must to post comments
0
0

I’m implementing the same thing, using getWaveData() asking for 2000 samples.

The problem I’m running into is that the values are extremely low. I’m adding the absolute value of all the samples together, then dividing by 2000 (number of samples)

When I’m playing loud sounds, the average energy typically hovers around .05. Whenever I’m hearing background/ambient audio it hovers around .01

Is this normal? Those values seem correct if they’re multiplied by a factor of 10 or so ("loud" but not clipping = .5, regular = .1)

  • You must to post comments
0
0

[quote="Dogbert":1i8pnxcg]I’m implementing the same thing, using getWaveData() asking for 2000 samples.

The problem I’m running into is that the values are extremely low. I’m adding the absolute value of all the samples together, then dividing by 2000 (number of samples)

When I’m playing loud sounds, the average energy typically hovers around .05. Whenever I’m hearing background/ambient audio it hovers around .01

Is this normal? Those values seem correct if they’re multiplied by a factor of 10 or so ("loud" but not clipping = .5, regular = .1)[/quote:1i8pnxcg]

I’m pretty sure you need to remember the largest value (or variation) of the sample, not the average.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.