Deepeshkumar Deepeshkumar - 1 month ago 16
Java Question

Do i need to record an audio to call getMaxAmplitude()?

The media recorder in android has a method


getMaxAmplitude()


I am making an application which deals with the amplitudes of sound falling on mic of a smartphone; it has nothing to do with actual sound recording.
The developer site says one can call getMaxAmplitude() after


setAudioSource().


So do I really need to record an audio to call getMaxAmplitude()?

Answer

The AudioRecord class needs to be recording sound for getMaxAmplitude to work, but you can throw away the bytes that you receive without saving them to a file or processing.

Comments