getAmplitude

abstract fun getAmplitude(samples: FloatArray, sampleRate: Int): Float

Get the amplitude (RMS) of the audio samples.

Automatically resamples to 16kHz internally if needed.

Return

RMS amplitude value

Parameters

samples

Audio samples as Float (-1.0 to 1.0 range)

sampleRate

Sample rate of the input audio