Drag[en]gine Script Module DragonScript
1.21
|
Immutable sound resources. More...
Public Member Functions | |
Management | |
String | getFilename () |
Filename. More... | |
int | getBytesPerSample () |
Bytes per sample. More... | |
int | getSampleCount () |
Number of samples. More... | |
int | getChannelCount () |
Number of channels. More... | |
int | getSampleRate () |
Sample rate. More... | |
float | getPlayTime () |
Play time in seconds. More... | |
Constructors | |
Sound | new (String filename) |
Load sound from file. More... | |
static void | loadAsynchron (String filename, ResourceListener listener) |
Load sound from file asynchronously. More... | |
Immutable sound resources.
This is a native class. It can not be subclassed.
int Dragengine.Scenery.Sound.getBytesPerSample | ( | ) |
Bytes per sample.
int Dragengine.Scenery.Sound.getChannelCount | ( | ) |
Number of channels.
String Dragengine.Scenery.Sound.getFilename | ( | ) |
Filename.
float Dragengine.Scenery.Sound.getPlayTime | ( | ) |
Play time in seconds.
int Dragengine.Scenery.Sound.getSampleCount | ( | ) |
Number of samples.
int Dragengine.Scenery.Sound.getSampleRate | ( | ) |
Sample rate.
|
static |
Load sound from file asynchronously.
Registers a request in the game engine to load an sound. Once finished or if the file is already loaded the listener is used to deliver the loaded sound or null if the loading failed.
Sound Dragengine.Scenery.Sound.new | ( | String | filename | ) |
Load sound from file.
If the sound file has been already loaded it is assigned to this object. If the sound is not loaded yet the engine loads the sound. This call blocks until the sound is fully loaded and ready to be used. Depending on the audio and synthesizer modules set by the user this can consume some time before finishing. For asynchronous loading use loadAsynchron(). Multiple objects can point to the same loaded sound resource. Once no object instance uses an sound file anymore it is released from memory.