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 class
ReplayGain.Type
Type 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 boolean
equals(Object o)
String
getAlgorithm()
int
getBitsPerSample()
float
getDecibelChange()
float
getNormPeak()
Peak as value between 0 and 1 (incl.).int
getPeak()
float
getReferenceLevel()
int
hashCode()
static float
intPeakToNormPeak(int peak, int bitDepth)
static int
normPeakToIntPeak(float normPeak, int bitDepth)
void
readExternal(ObjectInput in)
void
setAlgorithm(String algorithm)
void
setBitsPerSample(int bitsPerSample)
void
setDecibelChange(float decibelChange)
void
setNormPeak(float normPeak)
Sets peak as value between 0 and 1 (incl.).void
setPeak(int peak)
void
setReferenceLevel(float referenceLevel)
String
toJSONString()
String
toString()
void
writeExternal(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:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.simple.JSONAware
-
-