On further investigation of the Vizualizer class (it's been a while since I've looked at it), there is already a getMeasurementPeakRMS method, although there is a bug in the code. if you want to try it you will need to change the sub in the Visualizer class to:
'Retrieves the latest peak AND RMS measurement.
Sub getMeasurementPeakRms As PeakRMS
Dim PRMS As JavaObject
PRMS.InitializeNewInstance("android.media.audiofx.Visualizer.MeasurementPeakRms",Null)
Viz.RunMethod("getMeasurementPeakRms",Array(PRMS))
Dim Result As PeakRMS
Result.mPeak = PRMS.GetField("mPeak")
Result.mRMS = PRMS.GetField("mRms")
Return Result
End Sub
In the original the Array() definitions is missing from the line : viz.RunMethod("getMeasurementPeakRms",Array(PRMS))
It appears I forgot to update the main project when the bug was reported, either change it manually or download the separate visualizer,bas file. I will update it properly later.
Also you will need to set the measurement mode:
in the Activity create sub,