Difference between revisions of "Audio Module"

From SolarStrike wiki
Jump to: navigation, search
(Created page with "== load() == '''resource audio.load(string filename)''' Load a sound file and returns the resource. Returns nil on failure. == unload() == '''audio.unload(userdata resource...")
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== load() ==
+
== load ==
 
'''resource audio.load(string filename)'''
 
'''resource audio.load(string filename)'''
  
Line 5: Line 5:
  
  
== unload() ==
+
== unload ==
 
'''audio.unload(userdata resource)'''
 
'''audio.unload(userdata resource)'''
  
Line 11: Line 11:
  
  
== play() ==
+
== play ==
 
'''audio.play(userdata resource)'''
 
'''audio.play(userdata resource)'''
  
Line 17: Line 17:
  
  
== stop() ==
+
== stop ==
 
'''audio.stop(userdata resource)'''
 
'''audio.stop(userdata resource)'''
  
Line 23: Line 23:
  
  
== pause() ==
+
== pause ==
 
'''audio.pause(userdata resource)'''
 
'''audio.pause(userdata resource)'''
  
Line 29: Line 29:
  
  
== getState() ==
+
== getState ==
 
'''string audio.getState(userdata resource)'''
 
'''string audio.getState(userdata resource)'''
  
Line 36: Line 36:
  
  
== setLooping() ==
+
== setLooping ==
 
'''audio.setLooping(userdata resource, boolean looping)'''
 
'''audio.setLooping(userdata resource, boolean looping)'''
  
Line 42: Line 42:
  
  
== setVolume() ==
+
== setVolume ==
 
'''audio.setVolume(userdata resource, number volume)'''
 
'''audio.setVolume(userdata resource, number volume)'''
  
 
Sets the volume for an audio resource. 0 = no volume, 1 = full volume.
 
Sets the volume for an audio resource. 0 = no volume, 1 = full volume.

Latest revision as of 23:46, 17 February 2015

load

resource audio.load(string filename)

Load a sound file and returns the resource. Returns nil on failure.


unload

audio.unload(userdata resource)

Unloads an audio resource and sets its buffer & sources to empty (AL_NONE).


play

audio.play(userdata resource)

Plays a loaded audio resource.


stop

audio.stop(userdata resource)

Stops an audioresource (if it is playing).


pause

audio.pause(userdata resource)

Pause an audio resource (if it is playing).


getState

string audio.getState(userdata resource)

Returns the state of an audioresource as a string. The string will be one of these values: initial, playing, paused, stopped, unknown


setLooping

audio.setLooping(userdata resource, boolean looping)

Sets the "looping" state for an audio resource; true = loop it, false = no looping.


setVolume

audio.setVolume(userdata resource, number volume)

Sets the volume for an audio resource. 0 = no volume, 1 = full volume.