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 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.