views:

87

answers:

1

Does Android have a similar method to the iPhone AVAudioPlayer's averagePowerForChannel?

I want to get an average reading of the amplitude of as a value.

+1  A: 

I don't think there is a built-in function but you can calculate it yourself.

To do this, calculate the root-mean-square average of continuous samples.

rms = sqrt((sample0^2 + sample1^2 + sample2^2 + sample3^2) / numberOfSamples)

The following links should be helpful to you as they contain the full source code to two excellent Android sound related projects.

Ringdroid

Rehearsal Assistant

Timothy Lee Russell