|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an interface to a sound engine that can be thought to be a "sound device". Sample engines are used to load sample data stored in Microsoft RIFF WAV format (8/16-bit, any sample rate, stereo/mono) or music files in MIDI format. The loaded sample or music file is returned as an control object that is then used to play the sample.
Sample
Method Summary | |
java.lang.String |
getDataDirectory()
Returns the data directory wherefrom the sounds are loaded. |
java.lang.String |
getDescription()
Returns the (possibly multiline) description of the implementation. |
java.lang.String |
getName()
Returns the short name (max 8 characters) of the implementation e.g. |
Music |
loadMusic(java.lang.String fileName)
First tries to load a music file as streamed Microsoft RIFF WAV file, if no such file is found from the current data directory, tries to load a music file in MIDI format. |
Sample |
loadSample(java.lang.String fileName)
Loads a sample in Microsoft RIFF WAV format and returns the control object for the sample. |
void |
setDataDirectory(java.lang.String strDirectoryName)
Sets the data directory wherefrom the sounds are loaded. |
Method Detail |
public void setDataDirectory(java.lang.String strDirectoryName) throws java.io.FileNotFoundException
Sets the data directory wherefrom the sounds are loaded. The source directory defaults to the current directory.
Note: Remember to use the java.io.File.separator as the separator of directories.
strDirectoryName
- The name of the directory that contains the bitmaps.java.io.FileNotFoundException
- Thrown if the directory is not found.loadSample(java.lang.String)
,
loadMusic(java.lang.String)
public java.lang.String getDataDirectory()
loadSample(java.lang.String)
,
loadMusic(java.lang.String)
public Sample loadSample(java.lang.String fileName) throws java.io.FileNotFoundException, GameFrameException
fileName
- The name of the file to be loaded (without the file extension)setDataDirectory(java.lang.String)
public Music loadMusic(java.lang.String fileName) throws java.io.FileNotFoundException, GameFrameException
fileName
- The name of the file to be loaded (without the file extension)setDataDirectory(java.lang.String)
public java.lang.String getName()
public java.lang.String getDescription()
|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |