1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

* added workaround for sound (SDL)

git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@218 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
skomoroh 2008-02-09 23:24:03 +00:00
parent 8a58baa9eb
commit f7114887e4

View file

@ -430,6 +430,16 @@ class PyGameAudioClient(AbstractAudioClient):
# for py2exe
import pygame.base, pygame.rwobject, pygame.mixer_music
self.mixer = pygame.mixer
## http://www.pygame.org/docs/ref/mixer.html
## NOTE: there is currently a bug on some windows machines which
## makes sound play back 'scratchy'. There is not enough cpu in
## the sound thread to feed the buffer to the sound api. To get
## around this you can increase the buffer size. However this
## means that there is more of a delay between the time you ask to
## play the sound and when it gets played. Try calling this before
## the pygame.init or pygame.mixer.init calls.
## pygame.mixer.pre_init(44100,-16,2, 1024 * 3)
self.mixer.pre_init(44100, -16, 2, 1024 * 3)
self.mixer.init()
self.music = self.mixer.music
self.time = pygame.time