getVADRatio

fun getVADRatio(samples: FloatArray, sampleRate: Int = 16000): Float

Get ratio of voiced frames in audio (0.0 to 1.0). Higher values indicate more speech/singing content.

Accepts any sample rate and resamples internally to 16kHz.

Return

Voiced frame ratio (0.0 = silence, 1.0 = continuous voice)

Parameters

samples

Audio samples (mono, normalized -1.0 to 1.0)

sampleRate

Sample rate of the input audio in Hz (default: 16000)