|
|||||||||
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.FSSoundStreamHead2
public class FSSoundStreamHead2
FSSoundStreamHead2 defines an sound compressed using different compression formats that is streamed in tight synchronisation with the movie being played.
The FSSoundStreamHead2 class defines how the streaming sound is played. Objects of the FSSoundStreamBlock class contains the sound data.
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.
To define the stream sound the parameters for and sampled sound and how it will be played back must be specified:
Attributes | |
---|---|
type | Identifies the data structure when it is encoded. Read-only. |
format | The format of the encoded sound data - FSSound.PCM (Little-Endian byte order), FSSound.ADPCM, FSSound.NATIVE_PCM (Big-Endian or Little-Endian byte order depending on the platform where the sound was created), FSSound.MP3 or FSSound.NELLYMOSER |
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 stream sampling rate - 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 sound stream block. |
latency | Latency defines the number of samples to skip only when playing sounds encoded with the MP3 format. |
FSSoundStreamHead2 allows way the sound is played to differ from the way it is encoded and streamed to the player. This allows the Player more control over how the animation is rendered. Reducing the resolution or playback rate can improve synchronisation with the frames displayed.
HistoryThe FSSoundStreamHead2 class represents the SoundStreamHead structure from the Flash specification. It was introduced in Flash 3. Support for the Nellymoser Asao format was added in Flash 6.
Field Summary |
---|
Constructor Summary | |
---|---|
FSSoundStreamHead2(FSCoder coder)
Construct an FSSoundStreamHead2 object, initialising it with values decoded from an encoded object. |
|
FSSoundStreamHead2(FSSoundStreamHead2 obj)
Constructs an FSSoundStreamHead2 object by copying values from an existing object. |
|
FSSoundStreamHead2(int encoding,
int playRate,
int playChannels,
int playSize,
int streamingRate,
int streamingChannels,
int streamingSize,
int streamingCount,
int latency)
Constructs an FSSoundStreamHead2 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 FSSoundStreamHead2(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSSoundStreamHead2(int encoding, int playRate, int playChannels, int playSize, int streamingRate, int streamingChannels, int streamingSize, int streamingCount, int latency)
encoding
- the compression format for the sound data, either
FSSound.NATIVE_PCM, FSSound.ADPCM, FSSound.MP3, FSSound.PCM or
FSSound.NELLYMOSER (Flash 6+ only).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, either 1 or 2 bytes.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 FSSoundStreamHead2(FSSoundStreamHead2 obj)
obj
- an FSSoundStreamHead2 object.Method Detail |
---|
public int getFormat()
public void setFormat(int encoding)
encoding
- the compression format for the sound data, either
FSSound.NATIVE_PCM, FSSound.ADPCM, FSSound.MP3, FSSound.PCM or
FSSound.NELLYMOSER.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 |