def __init__(self): self.source = al.ALuint(0) al.alGenSources(1, self.source) al.alSourcef(self.source, al.AL_ROLLOFF_FACTOR, 0) al.alSourcei(self.source, al.AL_SOURCE_RELATIVE, 0) self.state = al.ALint(0) self._volume = 1.0 self._pitch = 1.0 self._position = [0, 0, 0] self._rolloff = 1.0 self._loop = False self.queue = []
def __init__(self): #load source player self.source = al.ALuint(0) al.alGenSources(1, self.source) #disable rolloff factor by default al.alSourcef(self.source, al.AL_ROLLOFF_FACTOR, 0) #disable source relative by default al.alSourcei(self.source, al.AL_SOURCE_RELATIVE, 0) #capture player state buffer self.state = al.ALint(0) #set internal variable tracking self._volume = 1.0 self._pitch = 1.0 self._position = [0, 0, 0] self._rolloff = 1.0 self._loop = False self.queue = []
def __init__(self): # load source player self.source = al.ALuint(0) al.alGenSources(1, self.source) # disable rolloff factor by default al.alSourcef(self.source, al.AL_ROLLOFF_FACTOR, 0) # disable source relative by default al.alSourcei(self.source, al.AL_SOURCE_RELATIVE, 0) # capture player state buffer self.state = al.ALint(0) # set internal variable tracking self._volume = 1.0 self._pitch = 1.0 self._position = [0, 0, 0] self._rolloff = 1.0 self._loop = True self.queue = []
def set_cone_inner_angle(self, cone_inner_angle): al.alSourcef(self._al_source, al.AL_CONE_INNER_ANGLE, cone_inner_angle)
def set_pitch(self, pitch): al.alSourcef(self._al_source, al.AL_PITCH, max(0, pitch))
def _set_max_gain(self, max_gain): al.alSourcef(self._al_source, al.AL_MAX_GAIN, max(0, max_gain)) self._max_gain = max_gain
def _set_pitch(self, pit): self._pitch = pit al.alSourcef(self.source, al.AL_PITCH, pit)
def set_cone_outer_angle(self, cone_outer_angle): al.alSourcef(self._al_source, al.AL_CONE_OUTER_ANGLE, cone_outer_angle)
def set_max_distance(self, max_distance): al.alSourcef(self._al_source, al.AL_MAX_DISTANCE, max_distance)
def set_min_distance(self, min_distance): al.alSourcef(self._al_source, al.AL_REFERENCE_DISTANCE, min_distance)
def set_volume(self, volume): al.alSourcef(self._al_source, al.AL_GAIN, max(0, volume))
def set_cone_outer_gain(self, cone_outer_gain): al.alSourcef(self._al_source, al.AL_CONE_OUTER_GAIN, cone_outer_gain)
def _set_rolloff(self, value): self._rolloff = value al.alSourcef(self.source, al.AL_ROLLOFF_FACTOR, value)
def _set_volume(self, vol): self._volume = vol al.alSourcef(self.source, al.AL_GAIN, vol)
def _set_min_gain(self, min_gain): al.alSourcef(self._al_source, al.AL_MIN_GAIN, max(0, min_gain)) self._min_gain = min_gain