50 lines
652 B
Python
50 lines
652 B
Python
|
# Bryan Schumake (8/7/2010)
|
||
|
|
||
|
__all__ = ['audio']
|
||
|
|
||
|
import libsaria
|
||
|
call = libsaria.event.call
|
||
|
expand = libsaria.path.expand
|
||
|
exists = libsaria.path.exists
|
||
|
audio = None
|
||
|
|
||
|
|
||
|
def init():
|
||
|
global audio
|
||
|
import audio
|
||
|
audio.init()
|
||
|
|
||
|
|
||
|
def end_of_song():
|
||
|
global audio
|
||
|
return call("EOS", audio.reset)
|
||
|
|
||
|
|
||
|
def load(file):
|
||
|
global audio
|
||
|
if audio == None:
|
||
|
init()
|
||
|
|
||
|
global expand
|
||
|
file = expand(file)
|
||
|
if not exists(file):
|
||
|
return False
|
||
|
return call("LOAD", audio.load, file)
|
||
|
|
||
|
|
||
|
def play():
|
||
|
global audio
|
||
|
return call("PLAY", audio.play)
|
||
|
|
||
|
|
||
|
def pause():
|
||
|
global audio
|
||
|
return call("PAUSE", audio.pause)
|
||
|
|
||
|
|
||
|
def stop():
|
||
|
global audio
|
||
|
return call("STOP", audio.stop)
|
||
|
|
||
|
|