|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.FSTransformObject
com.flagstone.transform.FSEnvelope
public class FSEnvelope
FSEnvelope is used to define an envelope which controls how a particular sound is played over time.
Each FSEnvelope object defines a point in the envelope. The FSSound object contains an array of FSEnvelope objects which define the complete envelope.
Attributes | |
---|---|
mark | The location in the playback sound data stream where the following level information applies. |
left | The sound level for the left channel, in the range 0..65535. |
right | The sound level for the right channel, in the range 0..65535.. |
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 envelope 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.
The FSEnvelope class represents the SoundEnvelope structure from the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 1.
Constructor Summary | |
---|---|
FSEnvelope(FSCoder coder)
Construct an FSEnvelope object, initialising it with values decoded from an encoded object. |
|
FSEnvelope(FSEnvelope obj)
Constructs an FSEnvelope object by copying values from an existing object. |
|
FSEnvelope(int markValue,
int leftValue,
int rightValue)
Constructs an envelope specifying the mark, left and right values. |
Method Summary | |
---|---|
void |
appendDescription(java.lang.StringBuffer buffer,
int depth)
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. |
void |
decode(FSCoder coder)
|
void |
encode(FSCoder coder)
|
boolean |
equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. |
int |
getLeft()
Gets the level of the sound played in the left channel. |
int |
getMark()
Gets the sample number in the 44.1KHz playback data stream where the level information is applied. |
int |
getRight()
Gets the level of the sound played in the right channel. |
int |
length(FSCoder coder)
|
void |
setLeft(int leftValue)
Sets the level for the left sound channel. |
void |
setMark(int aNumber)
Sets the sample number in the 44.1KHz playback data stream where the levels for the channels is applied. |
void |
setRight(int rightValue)
Sets the level for the right sound channel. |
Methods inherited from class com.flagstone.transform.FSTransformObject |
---|
clone, name, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FSEnvelope(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSEnvelope(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.public FSEnvelope(FSEnvelope obj)
obj
- an FSEnvelope object.Method Detail |
---|
public int getMark()
public int getLeft()
public int getRight()
public void setMark(int aNumber)
aNumber
- the mark value.public void setLeft(int leftValue)
leftValue
- the level for the left sound channel.public void setRight(int rightValue)
rightValue
- the level for the right sound channel.public boolean equals(java.lang.Object anObject)
equals
in class FSTransformObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSTransformObject
buffer
- a StringBuffer to which the description of each object is
appended.depth
- the maximum level of nesting up to which objects will be
displayed.public int length(FSCoder coder)
length
in class FSTransformObject
public void encode(FSCoder coder)
encode
in class FSTransformObject
public void decode(FSCoder coder)
decode
in class FSTransformObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |