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

Mono audio samples as Float (-1.0 to 1.0). Must be single-channel.

sampleRate

Sample rate of the input audio in Hz