|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.util.sound.SoundFactory
public final class SoundFactory
SoundFactory is used to generate the objects representing an event or streaming sound from an sound stored in a file, references by a URL or read from an stream. An plug-in architecture allows decoders to be registered to handle different formats. The SoundFactory provides a standard interface for using the different decoders for each supported sound format.
| Constructor Summary | |
|---|---|
SoundFactory()
|
|
| Method Summary | |
|---|---|
DefineSound |
defineSound(int identifier)
Create a definition for an event sound that can be added to a Flash movie. |
DefineSound |
defineSound(int identifier,
float duration)
Create a definition for an event sound that can be added to a Flash movie. |
void |
read(File file)
Decode a sound located in the specified file. |
void |
read(InputStream stream)
Decode a sound from a stream. |
void |
read(URL url)
Decode a sound referenced by a URL. |
MovieTag |
streamHeader(float frameRate)
Generate the header for a streaming sound. |
MovieTag |
streamSound()
Generate a SoundStreamBlock with next set of sound samples. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SoundFactory()
| Method Detail |
|---|
public void read(File file)
throws IOException,
DataFormatException
file - a file containing the abstract path to the sound.
IOException - if there is an error reading the file.
DataFormatException - if there is a problem decoding the sound, either it is in an
unsupported format or an error occurred while decoding the
sound data.
public void read(URL url)
throws IOException,
DataFormatException
url - the Uniform Resource Locator referencing the file.
IOException - if there is an error reading the file.
DataFormatException - if there is a problem decoding the sound, either it is in an
unsupported format or an error occurred while decoding the
sound data.
public void read(InputStream stream)
throws IOException,
DataFormatException
stream - the InputStream containing the sound data.
IOException - if there is an error reading the stream.
DataFormatException - if there is a problem decoding the sound, either it is in an
unsupported format or an error occurred while decoding the
sound data.
public DefineSound defineSound(int identifier)
throws IOException,
DataFormatException
identifier - the unique identifier for the sound.
IOException - if there is an error reading the file.
DataFormatException - if there is a problem decoding the sound, either it is in an
unsupported format or an error occurred while decoding the
sound data.
public DefineSound defineSound(int identifier,
float duration)
throws IOException,
DataFormatException
identifier - the unique identifier for the sound.duration - the number of seconds to play the sound for.
IOException - if there is an error reading the file.
DataFormatException - if there is a problem decoding the sound, either it is in an
unsupported format or an error occurred while decoding the
sound data.public MovieTag streamHeader(float frameRate)
frameRate - the frame rate for the movie so the sound can be divided
into sets of samples that can be played with each frame.
public MovieTag streamSound()
throws IOException,
DataFormatException
IOException - if there is an error reading the sound data.
DataFormatException - if the file contains an unsupported format.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||