Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.Sound Class Reference

Immutable sound resources. More...

Inheritance diagram for Dragengine.Scenery.Sound:

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...
 

Detailed Description

Immutable sound resources.

This is a native class. It can not be subclassed.

Member Function Documentation

◆ getBytesPerSample()

int Dragengine.Scenery.Sound.getBytesPerSample ( )

Bytes per sample.

◆ getChannelCount()

int Dragengine.Scenery.Sound.getChannelCount ( )

Number of channels.

◆ getFilename()

String Dragengine.Scenery.Sound.getFilename ( )

Filename.

◆ getPlayTime()

float Dragengine.Scenery.Sound.getPlayTime ( )

Play time in seconds.

◆ getSampleCount()

int Dragengine.Scenery.Sound.getSampleCount ( )

Number of samples.

◆ getSampleRate()

int Dragengine.Scenery.Sound.getSampleRate ( )

Sample rate.

◆ loadAsynchron()

static void Dragengine.Scenery.Sound.loadAsynchron ( String  filename,
ResourceListener  listener 
)
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.

◆ new()

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.


The documentation for this class was generated from the following file: