Drag[en]gine Script Module DragonScript Script API  1.0
Sound Class Reference

Immutable sound resources. More...

Inheritance diagram for Sound:

Public Member Functions

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


Sound new (String filename)
 Load sound from file. More...
static void loadAsynchron (String filename, ResourceNotifier notifier)
 Load sound from file asynchronously. More...

Detailed Description

Immutable sound resources.

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

Roland Pl├╝ss

Member Function Documentation

◆ getBytesPerSample()

int getBytesPerSample ( )

Bytes per sample.

◆ getChannelCount()

int getChannelCount ( )

Number of channels.

◆ getFilename()

String getFilename ( )


◆ getPlayTime()

float getPlayTime ( )

Play time in seconds.

◆ getSampleCount()

int getSampleCount ( )

Number of samples.

◆ getSampleRate()

int getSampleRate ( )

Sample rate.

◆ loadAsynchron()

static void loadAsynchron ( String  filename,
ResourceNotifier  notifier 

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 notifier is used to deliver the loaded sound or null if the loading failed.

◆ new()

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: