Class AudioLevelCalculator


  • public class AudioLevelCalculator
    extends Object
    Implements the calculation of audio level as defined by RFC 6465 "A Real-time Transport Protocol (RTP) Header Extension for Mixer-to-Client Audio Level Indication".
    Author:
    Lyubomir Marinov
    • Field Detail

      • MAX_AUDIO_LEVEL

        public static final byte MAX_AUDIO_LEVEL
        The maximum audio level.
        See Also:
        Constant Field Values
      • MIN_AUDIO_LEVEL

        public static final byte MIN_AUDIO_LEVEL
        The minimum audio level.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AudioLevelCalculator

        public AudioLevelCalculator()
    • Method Detail

      • calculateAudioLevel

        public static byte calculateAudioLevel​(byte[] samples,
                                               int offset,
                                               int length)
        Calculates the audio level of a signal with specific samples.
        Parameters:
        samples - the samples of the signal to calculate the audio level of
        offset - the offset in samples in which the samples start
        length - the length in bytes of the signal in samples starting at offset
        Returns:
        the audio level of the specified signal