public class SoundSample
extends java.lang.Object
Constructor and Description |
---|
SoundSample(SimpleSound sound,
int frameNumber)
Constructor that takes a sound and valueArray
|
Modifier and Type | Method and Description |
---|---|
static int |
correctLevel(double level)
Round and correct a color level to be within (-32768, 32767),
according to the current wrapLevels setting.
|
static int |
correctLevel(int level)
Correct a sample level to be within (-32768, 32767),
according to the current wrapLevels setting.
|
int |
getValue()
Method to get the value of this sample as in int
and handle the possible sound exception
|
static boolean |
getWrapLevels()
Indicates whether levels outside the range (-32768, 32767) are clamped
or wrapped around (saturating or modular arithmetic).
|
void |
setValue(int value)
Method to set the value of this sample and
handle the sound exception
|
static void |
setWrapLevels(boolean wrap)
Changes Sample's behavior for dealing with levels outside the range
(-32768, 32767).
|
java.lang.String |
toString()
Method to return a string with the information about
this object
|
public SoundSample(SimpleSound sound, int frameNumber)
sound
- the sound object this sample comes fromframeNumber
- the frameNumber of this sample in the soundpublic static boolean getWrapLevels()
public static void setWrapLevels(boolean wrap)
wrap
- If true, values will be wrapped (modular arithmetic).
If false, values will be clamped (saturating arithmetic).public static int correctLevel(double level)
level
- The user-provided level.public static int correctLevel(int level)
level
- The user-provided level.public int getValue()
public void setValue(int value)
value
- the value to usepublic java.lang.String toString()
toString
in class java.lang.Object