Sound

Thin wrap around Mix_Chunk including loading [FLAC, MikMod, Ogg Vorbis, MP3, Wav] using SDL_Mixer.

Constructors

this
this(string path)

Loads a sound file

Destructor

~this
~this()
Undocumented in source.

Members

Functions

dispose
void dispose()

Deallocates the memory and invalidates this.

fadeIn
int fadeIn(int ms, int loops, int channel, int maxTicks)

Plays this sound in the selected channel with a fade in effect.

play
int play(int loops, int channel, int maxTicks)

Plays this sound in the selected channel.

Properties

error
string error [@property getter]

Returns the latest sound related error

fadingStatus
int fadingStatus [@property setter]
handle
Mix_Chunk* handle [@property getter]

Handle to the Mix_Chunk*.

isPaused
int isPaused [@property setter]

Tells you how many channels are paused if set to -1

isPlaying
int isPlaying [@property setter]

Tells you how many channels are playing if set to -1

valid
bool valid [@property getter]

Checks if the handle is not null.

Static functions

fromChunk
Sound fromChunk(Mix_Chunk* chunk)

Creates sound from a Mix_Chunk*.

getVolume
float getVolume(int channel)

Returns the current volume as float in range 0.0 to 1.0

pause
void pause(int channel)

Pause the sound playback. You may halt paused sounds.

resume
void resume(int channel)

Unpause the sound. This is safe to use on halted, paused, and already playing sounds.

setVolume
void setVolume(float value, int channel)

Sets the current volume as float in range 0.0 to 1.0

stop
void stop(int channel)

Halt playback of sound. This interrupts sound fader effects.

Meta