Sound

Sound module and also music (if you set the repeat parameter).

Constructors

this
this()

Allocates space for the source and buffer.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

allocateBuffer
void allocateBuffer()

Allocates space for the buffer.

allocateSource
void allocateSource()

Allocates space for the source.

bind
void bind(Wav wave)

Inserts music data into the buffer for further playback.

copySource
Sound copySource()

Based on sound, reproduces a different sound using the same buffer, but with different sources. This makes it possible to play the same sound without stopping each other.

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
inSourceBindBuffer
void inSourceBindBuffer()

The source enters a buffer of sound or music for further playback.

isPaused
bool isPaused()

shows if music is currently paused.

isPlay
bool isPlay()

Shows if music is currently playing.

load
void load(string path)

Load sound from file.

pause
void pause()

Pauses playback sound, keeping its position.

play
void play()

Starts playing the sound (if the sound is already played, then the sound will start acting back).

resume
void resume()

Resume playback sound. (Alias play)

stop
void stop()

Stops playing sound or music.

Properties

bufferID
uint bufferID [@property getter]

Buffer identificator.

bufferID
uint bufferID [@property setter]

Buffer identificator.

currentDuration
Duration currentDuration [@property getter]
Duration currentDuration [@property setter]

The current position of the music in seconds.

duration
Duration duration [@property getter]

Estimated sound time (duration) in seconds.

gain
float gain [@property setter]

Sound gain effect (range 0 .. 1)

loop
bool loop [@property setter]

Do I need to repeat the sample.

pitch
float pitch [@property setter]

Sound speed (0.25 .. 2)

position
Vector!float position [@property setter]
Vector!float position [@property getter]

The position of the sound in the plane.

volume
uint volume [@property setter]

Sound source volume control.

Static functions

stopAll
void stopAll()

Stops all sound sources

Meta