I want to normalize volume level of the PCM stream decoded by me that comes encoded over sockets by grouping short bursts of samples. Instead of multiplying each sample with 1-(peakSample/32367.0)+1, I use Visualizer to get peak value and use it in LoudnessEnhancer to add gain. (so, when Visualizer reports -3200 peak, I add 3200 as targetGain with LoudnessEnhancer)The problem is Visualizer depends on the device volume even if I change the measurement scale of Visualizer. So, is there a way to get device-volume independent measurement from Visualizer as I do not want to calculate rms and peak myself if there is already a well tested working android code.

0 Answers