Class AudioLevelCalculator

  • All Implemented Interfaces:

    
    public final class AudioLevelCalculator
    
                        

    Utility class to calculate the normalized audio level from a PCM byte buffer. Supports 8/16 bit, signed/unsigned, and endianness options.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Float calculateLevel(ByteArray buffer, Integer readPoint, Integer leftOver, Boolean bigEndian) Calculates the normalized audio level (0.0 ~ 1.0) from the given buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AudioLevelCalculator

        AudioLevelCalculator()
    • 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 data
        readPoint - Start index in buffer
        leftOver - Number of bytes to ignore at the end
        bigEndian - True if buffer is big-endian, false for little-endian (optional, default: BIG_ENDIAN)
        Returns:

        Normalized audio level