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

Immutable sound resources. More...

Inheritance diagram for 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...
 
bool getStreaming ()
 Sound source is streaming. More...
 

Constructors

Sound new (String filename, bool streaming)
 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.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ getBytesPerSample()

int getBytesPerSample ( )

Bytes per sample.

§ getChannelCount()

int getChannelCount ( )

Number of channels.

§ getFilename()

String getFilename ( )

Filename.

§ getPlayTime()

float getPlayTime ( )

Play time in seconds.

§ getSampleCount()

int getSampleCount ( )

Number of samples.

§ getSampleRate()

int getSampleRate ( )

Sample rate.

§ getStreaming()

bool getStreaming ( )

Sound source is streaming.

§ loadAsynchron()

static void loadAsynchron ( String  filename,
ResourceNotifier  notifier 
)
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 notifier is used to deliver the loaded sound or null if the loading failed.

§ new()

Sound new ( String  filename,
bool  streaming 
)

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