Contents
Class AudioUtil
java.lang.Object
com.hypixel.hytale.common.util.AudioUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatMaximum accepted volume in decibels.static final floatMaximum accepted pitch shift in semitones for normal authoring. +12 = +1 octave.static final floatMaximum accepted pitch shift in semitones for state-binding deltas and call-site modifiers.static final floatMinimum accepted volume in decibels.static final floatMinimum accepted pitch shift in semitones for "normal" authoring (e.g.static final floatMinimum accepted pitch shift in semitones for state-binding deltas and call-site modifiers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatdecibelsToLinearGain(float decibels) Converts a volume decibel value into OpenAL's linear gain value.static floatlinearGainToDecibels(float linearGain) Converts OpenAL's linear gain value into a volume decibel value.static floatlinearPitchToSemitones(float linearPitch) Converts OpenAl's linear pitch value into a pitch in semitones.static floatsemitonesToLinearPitch(float semitones) Converts a pitch in semitones into a OpenAl's linear pitch value.
-
Field Details
-
MIN_DECIBEL_VOLUME
public static final float MIN_DECIBEL_VOLUMEMinimum accepted volume in decibels.-100dB and under is equivalent to no sound being played.
- See Also:
-
MAX_DECIBEL_VOLUME
public static final float MAX_DECIBEL_VOLUMEMaximum accepted volume in decibels.10dB is an arbitrary number and is equivalent to multiplying the original sound volume by 3.
- See Also:
-
MIN_SEMITONE_PITCH
public static final float MIN_SEMITONE_PITCHMinimum accepted pitch shift in semitones for "normal" authoring (e.g. SoundEventLayer random pitch variation). -12 semitones = -1 octave.- See Also:
-
MAX_SEMITONE_PITCH
public static final float MAX_SEMITONE_PITCHMaximum accepted pitch shift in semitones for normal authoring. +12 = +1 octave.- See Also:
-
MIN_STATE_PITCH_SEMITONES
public static final float MIN_STATE_PITCH_SEMITONESMinimum accepted pitch shift in semitones for state-binding deltas and call-site modifiers. Extended downward from the normal range to support "time stop" / record-winding-down style effects.- See Also:
-
MAX_STATE_PITCH_SEMITONES
public static final float MAX_STATE_PITCH_SEMITONESMaximum accepted pitch shift in semitones for state-binding deltas and call-site modifiers.- See Also:
-
-
Constructor Details
-
AudioUtil
public AudioUtil()
-
-
Method Details
-
decibelsToLinearGain
public static float decibelsToLinearGain(float decibels) Converts a volume decibel value into OpenAL's linear gain value.- Parameters:
decibels- the value.- Returns:
- an OpenAl's linear gain value.
- See Also:
-
linearGainToDecibels
public static float linearGainToDecibels(float linearGain) Converts OpenAL's linear gain value into a volume decibel value.- Parameters:
linearGain- the value.- Returns:
- a decibel value.
- See Also:
-
semitonesToLinearPitch
public static float semitonesToLinearPitch(float semitones) Converts a pitch in semitones into a OpenAl's linear pitch value.- Parameters:
semitones- the value.- Returns:
- an OpenAl's linear pitch value.
- See Also:
-
linearPitchToSemitones
public static float linearPitchToSemitones(float linearPitch) Converts OpenAl's linear pitch value into a pitch in semitones.- Parameters:
linearPitch- the value.- Returns:
- a pitch in semitones.
- See Also:
-