Skip to content

//sorisdk/com.iplateia.afplib/AudioLevelCalculator/calculateLevel

calculateLevel

[androidJvm]
fun calculateLevel(buffer: ByteArray, readPoint: Int, leftOver: Int, bigEndian: Boolean = BIG_ENDIAN): Float

Calculates the normalized audio level (0.0 ~ 1.0) from the given buffer.

Return

Normalized audio level

Parameters

androidJvm

bufferPCM audio data
readPointStart index in buffer
leftOverNumber of bytes to ignore at the end
bigEndianTrue if buffer is big-endian, false for little-endian (optional, default: BIG_ENDIAN)