audio.soundsystem

Sound system API.

class SoundException: object.Exception;

Base class for sound related exceptions.

class MusicInitException: audio.soundsystem.SoundException;

Thrown when music fails to load.

abstract class SoundSystem;

Base class for all sound system classes.

A sound system handles sound and music playback, volume control, etc.

void setSoundVolume(const float volume);

Set sound effects volume. Must be from inverval <0.0, 1.0> .

void playSound(string name, const float volume);

Start playing a sound effect.

Parameters:
string name VFS file name of the sound to play. Only OGG vorbis and WAV files are guaranteed to be supported.
float volume Relative volume of the sound effect. Must be from interval <0.0, 1.0>.
If the sound could not be played (e.g. because it couldn't be loaded) it will be silently ignored.
void setMusicVolume(const float volume);

Set music volume. Must be from inverval <0.0, 1.0> .

void playMusic(string name, Flag!("repeat") repeat = (Yes).repeat);

Start playing a music track.

Parameters:
string name VFS file name of the music track to play. Only OGG vorbis files are guaranteed to be supported.
Flag!("repeat") repeat Should the music track repeat infinitely?
Throws:
MusicInitException if the music file was not found, was corrupted, or in unsupported format.
void haltMusic();

Halt the currently played music track, if any.