Source code for yyagl.lib.p3d.audio

from panda3d.core import AudioSound


[docs]class P3dSound: def __init__(self, filepath): self.snd = loader.loadSfx(filepath)
[docs] def stop(self): return self.snd.stop()
[docs] def set_loop(self, val): return self.snd.set_loop(val)
[docs] def set_volume(self, vol): return self.snd.set_volume(vol)
[docs] def set_play_rate(self, rate): return self.snd.set_play_rate(rate)
[docs] def play(self): if self.snd.status() != AudioSound.PLAYING: return self.snd.play() return None
@property def playing(self): return self.snd.status() == AudioSound.PLAYING