Sound

Sound represents the functionality to manipulate loaded sounds. That means with this class you can get informations about the sound or you can play, stop or pause it.

Constructors

this
this()

CTor

this
this(BaseSoundFile soundfile)

CTor

this
this(string filename)

CTor

Members

Enums

Status
enum Status

Represents the current status.

Functions

free
void free()

Free / Release the source and buffer of the Sound

getChannel
const(Channel) getChannel()

Returns the current Channel.

getFilename
string getFilename()

Returns the current filename.

getFormat
ALenum getFormat()

Returns the Format.

getFreqeuency
uint getFreqeuency()

Returns the current frequency.

getLength
float getLength()

Returns the length in seconds.

getLooping
bool getLooping()

Returns if the looping is enabled or not.

getPosition
const(Vector3f) getPosition()

Returns the current position.

getSoundFile
BaseSoundFile getSoundFile()

Returns the interal Soundfile which contains the filename, the music type and the length in seconds.

getStatus
Status getStatus()

Returns the current status.

getType
MusicType getType()

Returns the music type.

getVelocity
const(Vector3f) getVelocity()

Returns the current velocity.

getVolume
ubyte getVolume()

Returns the current volume.

loadFromFile
void loadFromFile(BaseSoundFile soundfile)

Load from a soundfile.

loadFromFile
BaseSoundFile loadFromFile(string filename)

Load a soundfile from his path.

loadFromMemory
void loadFromMemory(void* buffer, uint dataSize, uint frequency, Channel ch)

Load from memory.

pause
void pause()

Pause playing.

play
void play(bool enable)

Activate the playing. If enable is true, the looping is also activated.

play
void play()

Activate the playing.

rewind
void rewind()

Rewind playing.

setLooping
void setLooping(bool enable)

Enable looping.

setPosition
void setPosition(Vector3f vpos)

Set the position.

setPosition
void setPosition(float x, float y, float z)

Set the position.

setVelocity
void setVelocity(Vector3f vvel)

Set the velocity.

setVelocity
void setVelocity(float x, float y, float z)

Set the velocity.

setVolume
void setVolume(float volume)

Set the volume.

setVolume
void setVolume(ubyte volume)

Set the volume.

stop
void stop()

Stop current playing.

Static functions

loadOnce
Sound loadOnce(BaseSoundFile soundfile)

Load a soundfile and stores the sound object in a static field. Then returns the sound object. If you try to load the same file on more time, you get the same sound object as before.

loadOnce
Sound loadOnce(string filename)

Load a soundfile from his path and stores the sound object in a static field. Then returns the sound object. If you try to load the same file on more time, you get the same sound object as before.

Meta

Authors

rschuett