|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.sound.Envelope.Level
public final class Envelope.Level
Level describes the sound levels for stereo sound.
Each Level object contains a sample number in the audio when it is played where the envelope will be applied along with the sound levels for the left and right channels.
The Flash Player plays sounds at a fixed rate of 44.1KHz, therefore sounds sampled at a lower frequency are interpolated with each sample repeated to generated the 44.1Khz playback rate. For example each sample in a sound sampled at 22KHz is played twice to generated the 44.1Khz playback rate.
The Level defines the sample number (and hence the time) in the playback data stream where the level information applies and not the sample number in the original sound data. For example to set the level 0.1 seconds into a sound that plays for 1 second the value for the mark attribute in the envelope object would be 44100 * 0.1/1.0 = 4410.
SoundInfo
Constructor Summary | |
---|---|
Envelope.Level(int markValue,
int leftValue,
int rightValue)
Creates a envelope specifying the mark, left and right sound levels. |
|
Envelope.Level(SWFDecoder coder)
Creates and initialises a sound Level object using values encoded in the Flash binary format. |
Method Summary | |
---|---|
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
boolean |
equals(Object object)
|
int |
getLeft()
Get the level of the sound played in the left channel. |
int |
getMark()
Get the sample number in the 44.1KHz playback data stream where the level information is applied. |
int |
getRight()
Get the level of the sound played in the right channel. |
int |
hashCode()
|
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Envelope.Level(SWFDecoder coder) throws IOException
coder
- an SWFDecoder object that contains the encoded Flash data.
IOException
- if an error occurs while decoding the data.public Envelope.Level(int markValue, int leftValue, int rightValue)
markValue
- the sample number in the 44.1KHz playback data stream
where the levels for the channels is applied.leftValue
- the level for the left sound channel, in the range
0..65535.rightValue
- the level for the right sound channel, in the range
0..65535.Method Detail |
---|
public int getMark()
public int getLeft()
public int getRight()
public String toString()
toString
in class Object
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int prepareToEncode(Context context)
prepareToEncode
in interface SWFEncodeable
context
- an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder, Context context) throws IOException
encode
in interface SWFEncodeable
coder
- an SWFEncoder object.context
- an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException
- if an error occurs while encoding the object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |