Class Loudness
- java.lang.Object
-
- com.tagtraum.audiokern.replaygain.Loudness
-
- All Implemented Interfaces:
Cloneable,org.json.simple.JSONAware
public class Loudness extends Object implements Cloneable, org.json.simple.JSONAware
Simple, decibel-based loudness curve.- Author:
- Hendrik Schreiber
-
-
Field Summary
Fields Modifier and Type Field Description static intABSOLUTE_SILENCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Loudnessappend(Loudness loudness)Concatenate this object with the given object.Objectclone()booleanequals(Object o)floatgetAverage(long start, long duration)Average loudness for a time range.floatgetGatedLoudness()Loudness corresponding to EBU R 128 with both the absolute -70 LUFS silence gate and the -10 LU relative gate applied.floatgetLoudnessRange()/**floatgetSampleRate()floatgetValue(int sample)floatgetValue(long time)Get the loudness value in db at the given time in milliseconds.floatgetValueAtPercentile(float percentile)Maximal loudness for the most quiet X% of the track.float[]getValues()inthashCode()StringtoJSONString()StringtoString()
-
-
-
Method Detail
-
append
public Loudness append(Loudness loudness)
Concatenate this object with the given object.- Parameters:
loudness- other loudness object- Returns:
- new object (concatenation of both objects)
-
getSampleRate
public float getSampleRate()
-
getAverage
public float getAverage(long start, long duration)Average loudness for a time range. If the time range contains silence, the resulting value may be meaningless, because of the logarithmic nature of the decibel scale.- Parameters:
start- start time in millisecondsduration- end time in milliseconds- Returns:
- average loudness
-
getValue
public float getValue(long time)
Get the loudness value in db at the given time in milliseconds.- Parameters:
time- time in milliseconds- Returns:
- loudness in db or, if the time is invalid,
ABSOLUTE_SILENCE
-
getValue
public float getValue(int sample)
-
getValues
public float[] getValues()
-
getValueAtPercentile
public float getValueAtPercentile(float percentile)
Maximal loudness for the most quiet X% of the track. Used with0.95fas parameter, this results in a perceived loudness as suggested by ReplayGain 1.- Parameters:
percentile- percentile- Returns:
- loudness value
-
getGatedLoudness
public float getGatedLoudness()
Loudness corresponding to EBU R 128 with both the absolute -70 LUFS silence gate and the -10 LU relative gate applied.
Requires suitable loudness values.
- Returns:
- loudness
-
getLoudnessRange
public float getLoudnessRange()
/**Loudness range corresponding to EBU R 128 with both the absolute -70 LUFS silence gate and the -20 LU relative gate applied.
Requires suitable loudness values.
- Returns:
- loudness range
-
toJSONString
public String toJSONString()
- Specified by:
toJSONStringin interfaceorg.json.simple.JSONAware
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-