Re: Sound Libraries in python

About the delay in pygame:
https://bitbucket.org/pygame/pygame/iss … ted-moment

In short, the default value for the buffer has been changed in version 1.8 to a huge value to avoid any scratchy sound. The trouble is that this value is not suited for games. Solution: before pygame.mixer.init() call:
pygame.mixer.pre_init(44100,-16, 2, 1024)

If it isn't enough, use an even smaller value for the buffer:
pygame.mixer.pre_init(44100,-16, 2, 512)

Extract from pygame 1.9 manual:
"NOTE: Not to get less laggy sound, use a smaller buffer size. The default is set to reduce the chance of scratchy sounds on some computers. You can change the default buffer by calling pygame.mixer.pre_init()preset the mixer init arguments before pygame.mixer.init()initialize the mixer module or pygame.init()initialize all imported pygame modules is called. For example: pygame.mixer.pre_init(44100,-16,2, 1024) The default size was changed from 1024 to 3072 in pygame 1.8."

Since the buffer value must be a power of 2, the real default value in pygame 1.8 is probably 4096, not 3072.

About computing stereo volume values from 2D coordinates, check the empiric formulas in this module (especially the function called "stereo"):
https://github.com/soundmud/soundrts/bl … iasound.py

URL: http://forum.audiogames.net/viewtopic.php?pid=170850#p170850

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
http://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Reply via email to