views:

84

answers:

3

Is there a way to do panning or 3d sound in Pygame? The only way I've found to control sound playback is to set the volume for both the left and right channels.

A: 

http://pysonic.sourceforge.net/

Try this out, it's a wrapper over the FMOD sound library, it won't disappoint :)

Tanner
IT doesn't look like it's been updated in several years.
Jared
A: 

I think setting the separate channel volume is the only way. Pygame doesn't seem to have any notion of world space or positioning for sounds.

Kylotan
A: 

You are correct - Pygame itself doesn't have any high-level way to position sound other than manually adjusting channel volumes (and it looks like it only supports stereo).

The best way, to do 3D-audio, especially for games, is to use OpenAL. Unfortunately, there's no way to this in Pygame (note that there is an OpenAL library in "pgreloaded," the next version of Pygame). Pyglet, however, does use OpenAL. I've never tried mixing Pygame and pyglet, though - I wonder if it would work?

Daniel G