Class ReplayGain
- java.lang.Object
-
- com.tagtraum.audiokern.replaygain.ReplayGain
-
- All Implemented Interfaces:
Externalizable,Serializable,org.json.simple.JSONAware
public class ReplayGain extends Object implements Externalizable, org.json.simple.JSONAware
Representing a replay gain.- Author:
- Hendrik Schreiber
- See Also:
- Replay Gain, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReplayGain.TypeType of replay gain.
-
Constructor Summary
Constructors Constructor Description ReplayGain()ReplayGain(String jsonString)Instantiate from JSON string.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetAlgorithm()intgetBitsPerSample()floatgetDecibelChange()floatgetNormPeak()Peak as value between 0 and 1 (incl.).intgetPeak()floatgetReferenceLevel()inthashCode()static floatintPeakToNormPeak(int peak, int bitDepth)static intnormPeakToIntPeak(float normPeak, int bitDepth)voidreadExternal(ObjectInput in)voidsetAlgorithm(String algorithm)voidsetBitsPerSample(int bitsPerSample)voidsetDecibelChange(float decibelChange)voidsetNormPeak(float normPeak)Sets peak as value between 0 and 1 (incl.).voidsetPeak(int peak)voidsetReferenceLevel(float referenceLevel)StringtoJSONString()StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
ReplayGain
public ReplayGain()
-
ReplayGain
public ReplayGain(String jsonString)
Instantiate from JSON string.- Parameters:
jsonString- json string- See Also:
toJSONString()
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
-
setAlgorithm
public void setAlgorithm(String algorithm)
-
getReferenceLevel
public float getReferenceLevel()
-
setReferenceLevel
public void setReferenceLevel(float referenceLevel)
-
getDecibelChange
public float getDecibelChange()
-
setDecibelChange
public void setDecibelChange(float decibelChange)
-
getPeak
public int getPeak()
-
getNormPeak
public float getNormPeak()
Peak as value between 0 and 1 (incl.).- Returns:
- normalized peak.
-
setNormPeak
public void setNormPeak(float normPeak)
Sets peak as value between 0 and 1 (incl.).- Parameters:
normPeak- normalized peak.
-
normPeakToIntPeak
public static int normPeakToIntPeak(float normPeak, int bitDepth)
-
intPeakToNormPeak
public static float intPeakToNormPeak(int peak, int bitDepth)
-
setPeak
public void setPeak(int peak)
-
getBitsPerSample
public int getBitsPerSample()
-
setBitsPerSample
public void setBitsPerSample(int bitsPerSample) throws IllegalArgumentException- Parameters:
bitsPerSample- bits per sample- Throws:
IllegalArgumentException- if the value is less than 1
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
toJSONString
public String toJSONString()
- Specified by:
toJSONStringin interfaceorg.json.simple.JSONAware
-
-