Actually, another approach may be to just manually adjust the volume based 
on a distance calculation from the players position and the position of the 
sound using the pyglet convience functions. The only issue with that is you 
don't get stereo positioning (which is what the OpenAL examples are more 
about), but can still get an effect to what you describe.

For example:
self.sound = pyglet.media.load('tone5.wav')
self.player = pyglet.media.Player()
self.player.queue(self.sound)
self.player.eos_action = 'loop'
self.player.play()

self.player_pos = [32,0]
self.sound_pos = [64,0]


if self.player_pos[0] < self.sound_pos[0]:
    self.player.volume = float(self.player_pos[0]) / float(self.sound_pos[0
])

if self.player.volume <= 0.0:
    self.player.pause()


-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to