From 7f54db11272f232c3763872ab3c297bc9a9d0eac Mon Sep 17 00:00:00 2001 From: skomoroh Date: Sat, 9 Feb 2008 23:24:03 +0000 Subject: [PATCH] * added workaround for sound (SDL) git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@218 efabe8c0-fbe8-4139-b769-b5e6d273206e --- pysollib/pysolaudio.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pysollib/pysolaudio.py b/pysollib/pysolaudio.py index 61e68b15..db61be2f 100644 --- a/pysollib/pysolaudio.py +++ b/pysollib/pysolaudio.py @@ -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