Package com.iplateia.afplib
Class AudioLevelCalculator
-
- All Implemented Interfaces:
public final class AudioLevelCalculatorUtility class to calculate the normalized audio level from a PCM byte buffer. Supports 8/16 bit, signed/unsigned, and endianness options.
-
-
Constructor Summary
Constructors Constructor Description AudioLevelCalculator()
-
Method Summary
-
-
Method Detail
-
calculateLevel
final Float calculateLevel(ByteArray buffer, Integer readPoint, Integer leftOver, Boolean bigEndian)
Calculates the normalized audio level (0.0 ~ 1.0) from the given buffer.
- Parameters:
buffer- PCM audio datareadPoint- Start index in bufferleftOver- Number of bytes to ignore at the endbigEndian- True if buffer is big-endian, false for little-endian (optional, default: BIG_ENDIAN)- Returns:
Normalized audio level
-
-
-
-