I want to implement a
VU meter in my recording app. My app is recording in
WAV format and I want the VU meter to update itself at each second.
Please guide me how to do this:
- let’s say the sample rate is 44100 . I find the max absolute value from audioData that comes in 1 sec. Should I do this:
int average = maxSampleValue / nrOfSamplesInOneSec;?
- I will convert the maxAmpl like this:
powerDb = 20 * log10(getAmplitude());
VUmeter will be a rectangle with a fill
color(green - yellow - red). What is the maximum height of this rectangle(in dB)? And the minimum? Where(in dB) the green color should change in yellow?
Please help me with this. Also, a (short)tutorial will be very convenient for me.