|
|||||||||
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.FSMovieObject
com.flagstone.transform.FSSoundStreamHead
public class FSSoundStreamHead
FSSoundStreamHead defines the format of a streaming sound, identifying the encoding scheme, the rate at which the sound will be played and the size of the decoded samples.
The actual sound is streamed used the FSSoundStreamBlock class which contains the data for each frame in a movie.
Attributes | |
---|---|
type | Identifies the data structure when it is encoded. Read-only. |
format | The format of the encoded sound data - FSSound.PCM (Little0endian byte order), FSSound.ADPCM, or FSSound.NATIVE_PCM (Big-endian or Little-Endian byte order depending on the platform where the sound was generated.). |
playbackRate | The recommended playback rate in Hertz - 5512, 11025, 22050 or 44100. |
playbackSampleSize | The number of bytes in an uncompressed sample when the sound is played, either 1 or 2. |
playbackChannels | The recommended number of playback channels: 1 = mono or 2 = stereo. |
streamRate | The rate at which the streaming sound was samples - 5512, 11025, 22050 or 44100 Hz. |
streamSampleSize | The size of an uncompressed sample in the streaming sound in bytes, either 1 or 2. |
streamChannels | The number of channels: 1 = mono or 2 = stereo, in the streaming sound |
streamSampleCount | The average number of samples in each FSSoundStreamBlock object. |
latency | Latency defines the number of samples to skip only when playing sounds encoded with the MP3 format. |
Four encoded formats for the sound data are supported:
Constants representing the different formats are defined in the FSSound class.
When a stream sound is played if the Flash Player cannot render the frames fast enough to maintain synchronisation with the sound being played then frames will be skipped. Normally the player will reduce the frame rate so every frame of a movie is played. The different sets of attributes that identify how the sound will be played compared to the way it was encoded allows the Player more control over how the animation is rendered. Reducing the resolution or playback rate can improve synchronisation with the frames displayed.
The FSSoundStreamHead class represents the SoundStreamHead structure from the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 1.
Field Summary |
---|
Constructor Summary | |
---|---|
FSSoundStreamHead(FSCoder coder)
Construct an FSSoundStreamHead object, initialising it with values decoded from an encoded object. |
|
FSSoundStreamHead(FSSoundStreamHead obj)
Constructs an FSSoundStreamHead object by copying values from an existing object. |
|
FSSoundStreamHead(int playRate,
int playChannels,
int playSize,
int streamingRate,
int streamingChannels,
int streamingSize,
int streamingCount,
int latency)
Constructs an FSSoundStreamHead object specifying all the parameters required to define the sound. |
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 |
getFormat()
Gets the streaming sound format. |
int |
getLatency()
For MP3 encoded sounds, returns the number of samples to skip when starting to play a sound. |
int |
getPlaybackChannels()
Gets the recommended number of playback channels = 1 = mono 2 = stereo. |
int |
getPlaybackRate()
Gets the recommended playback rate: 5512, 11025, 22050 or 44100 Hertz. |
int |
getPlaybackSampleSize()
Gets the recommended playback sample range in bytes: 1 or 2. |
int |
getStreamChannels()
Gets the number of channels, 1 = mono 2 = stereo, in the streaming sound. |
float |
getStreamRate()
Gets the sample rate: 5512, 11025, 22050 or 44100 Hz in the streaming sound. |
int |
getStreamSampleCount()
Gets the average number of samples in each stream block following. |
int |
getStreamSampleSize()
Gets the sample size in bytes: 1 or 2 in the streaming sound. |
int |
length(FSCoder coder)
|
void |
setFormat(int encoding)
Sets the format for the streaming sound. |
void |
setLatency(int latency)
Set the number of samples to skip when starting to play an MP3 encoded sound. |
void |
setPlaybackChannels(int aNumber)
Sets the recommended number of playback channels = 1 = mono 2 = stereo. |
void |
setPlaybackRate(int rate)
Sets the recommended playback rate in Hz. |
void |
setPlaybackSampleSize(int playSize)
Sets the recommended playback sample size in bytes. |
void |
setStreamChannels(int streamingChannels)
Sets the number of channels in the streaming sound: 1 = mono 2 = stereo. |
void |
setStreamRate(int rate)
Sets the sample rate in Hz for the streaming sound. |
void |
setStreamSampleCount(int streamingCount)
Sets the number of samples in each stream block. |
void |
setStreamSampleSize(int streamingSize)
Sets the sample size in bytes for the streaming sound. |
Methods inherited from class com.flagstone.transform.FSMovieObject |
---|
getType |
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 FSSoundStreamHead(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSSoundStreamHead(int playRate, int playChannels, int playSize, int streamingRate, int streamingChannels, int streamingSize, int streamingCount, int latency)
playRate
- the recommended rate for playing the sound, either 5512,
11025, 22050 or 44100 Hz.playChannels
- The recommended number of playback channels: 1 = mono or 2 =
stereo.playSize
- the recommended uncompressed sample size for playing the
sound, either 1 or 2 bytes.streamingRate
- the rate at which the sound was sampled, either 5512, 11025,
22050 or 44100 Hz.streamingChannels
- the number of channels: 1 = mono or 2 = stereo.streamingSize
- the sample size for the sound in bytes, either 1 or 2.streamingCount
- the number of samples in each subsequent FSSoundStreamBlock
object.latency
- defines the number of samples to skip only when playing sounds
encoded with the MP3 format.public FSSoundStreamHead(FSSoundStreamHead obj)
obj
- an FSSoundStreamHead object.Method Detail |
---|
public int getFormat()
public void setFormat(int encoding)
encoding
- the compression format for the sound data, either
FSSound.ADPCM or FSSound.MP3.public int getPlaybackRate()
public int getPlaybackChannels()
public int getPlaybackSampleSize()
public float getStreamRate()
public int getStreamChannels()
public int getStreamSampleSize()
public int getStreamSampleCount()
public void setPlaybackRate(int rate)
rate
- the recommended rate for playing the sound.public void setPlaybackChannels(int aNumber)
aNumber
- the recommended number of playback channels.public void setPlaybackSampleSize(int playSize)
playSize
- the recommended sample size for playing the sound.public void setStreamRate(int rate)
rate
- the rate at which the streaming sound was sampled.public void setStreamChannels(int streamingChannels)
streamingChannels
- the number of channels in the streaming sound.public void setStreamSampleSize(int streamingSize)
streamingSize
- the sample size for the sound.public void setStreamSampleCount(int streamingCount)
streamingCount
- the number of samples in each subsequent FSSoundStreamBlock
object.public int getLatency()
public void setLatency(int latency)
latency
- the number of samples to be skipped in an MP3 encoded sound
should be 0 for other sound formats.public boolean equals(java.lang.Object anObject)
FSMovieObject
equals
in class FSMovieObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSMovieObject
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 FSMovieObject
public void encode(FSCoder coder)
encode
in class FSMovieObject
public void decode(FSCoder coder)
decode
in class FSMovieObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |