net.java.sip.communicator.impl.neomedia.audiolevel
Class AudioLevelCalculator
java.lang.Object
net.java.sip.communicator.impl.neomedia.audiolevel.AudioLevelCalculator
public class AudioLevelCalculator
- extends Object
- Author:
- Damian Minkov, Lyubomir Marinov
|
Method Summary |
static int |
calculateSignalPowerLevel(byte[] samples,
int offset,
int length,
int minLevel,
int maxLevel,
int lastLevel)
Estimates the signal power and use the levelRatio to scale it to the
needed levels. |
static int |
calculateSoundPressureLevel(byte[] samples,
int offset,
int length,
int minLevel,
int maxLevel,
int lastLevel)
Calculates the sound pressure level of a signal with specific
samples and makes sure that it is expressed as a value in the
range between minLevel and maxLevel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AudioLevelCalculator
public AudioLevelCalculator()
calculateSignalPowerLevel
public static int calculateSignalPowerLevel(byte[] samples,
int offset,
int length,
int minLevel,
int maxLevel,
int lastLevel)
- Estimates the signal power and use the levelRatio to scale it to the
needed levels.
- Parameters:
samples - the samples of the signal to calculate the signal power
level ofoffset - the offset that data starts.length - the length of the dataminLevel - the minimum value of the resultmaxLevel - the maximum value of the resultlastLevel - the last level we calculated.
- Returns:
- the power of the signal in dB SWL.
calculateSoundPressureLevel
public static int calculateSoundPressureLevel(byte[] samples,
int offset,
int length,
int minLevel,
int maxLevel,
int lastLevel)
- Calculates the sound pressure level of a signal with specific
samples and makes sure that it is expressed as a value in the
range between minLevel and maxLevel.
- Parameters:
samples - the samples of the signal to calculate the sound pressure
level ofoffset - the offset in samples in which the samples startlength - the length in bytes of the samples in samples
starting at offsetminLevel - the minimum value of the level to be returnedmaxLevel - the maximum value of the level to be returnedlastLevel - the last level which has been previously calculated
- Returns:
- the sound pressure level of the specified signal as a value in
the range between minLevel and maxLevel
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.