Lua API  0.4.0
Game Engine
 All Files Functions
Sounds.lua File Reference

Functions

 playSound (object)
 Starts playing the given sound. More...
 
 pauseSound (object)
 Pauses the given sound. More...
 
 stopSound (object)
 Stops the given sound. More...
 
 getSoundGain (object)
 Retrieves the sound volume from the given sound object. More...
 
 setSoundGain (object, gain)
 Sets the sound volume of the given sound object. More...
 

Function Documentation

getSoundGain ( object  )

Retrieves the sound volume from the given sound object.

Parameters
objectA sound object.
Returns
A number.
pauseSound ( object  )

Pauses the given sound.

Playback can be resumed by using playSound.

Parameters
objectA sound object.
playSound ( object  )

Starts playing the given sound.

Parameters
objectA sound object.
setSoundGain ( object  ,
gain   
)

Sets the sound volume of the given sound object.

The volume level is should be between 0.0 and 1.0 to prevent distortion.

Parameters
objectA sound object.
gainA number between 0.0 and 1.0
stopSound ( object  )

Stops the given sound.

Playback can be restarted by using playSound.

Parameters
objectA sound object.