[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Panning with Channel.set_volume



Hi,

I am currently developing a multiplayer game with pygame (my system is a 
gentoo box with kernel 2.6.4, ALSA and sdl-mixer-1.2.5) and tried to use the 
Channel.set_volume function to pan the sounds. But to me it is unclear what 
the second parameter means: after reading the documentation of pygame and 
consulting the book "Game Programming with Python" from Sean Riley i still 
can't hear the difference between setting a panning value of 0.0 or 1.0. For 
example i tried the following in the python shell:
import pygame
pygame.init()
pygame.mixer.init()
snd = pygame.mixer.Sound('sounds/partyhorn.wav')
chan = pygame.mixer.find_channel()
chan.set_volume(1.0, 0.0)
chan.play(snd)
chan.set_volume(1.0, 1.0)
chan.play(snd)

Here i would think that the first played sound would only play on the left 
speaker and the second on the right speaker.  But as said before, i can't 
hear the difference! Maybe it's caused by non stereo sound samples? Perhaps i 
have misunderstood the set_volume method? 

Regards,
Matthias