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

Re: [pygame] sound crackling and fmod



Hi,

>>1) why am I getting the crackling when running the
>>demos?

>open the game's code and change in the mixer's
>initiation, the size of the buffer - it's the last
>parameter.  For instance if you find:
>pygame.mixer.init()
>then replace with:
>pygame.mixer.init(22050,-16,1,2048)
>or even:
>pygame.mixer.init(22050,-16,1,4096)

>that should fix it.

Unfortunately, I still can't solve the problem. The demo code has no call to pygame.mixer.init. Instead, the code (the Shadow of the Beast animation on the website) looks like:

...
pygame.init()

screen = pygame.display.set_mode((640, 480))
pygame.display.set_caption("Shadow of the Beast")

s1 = pygame.image.load(os.path.join("resources", "bgd1_ciel.png"))
s2 = pygame.image.load(os.path.join("resources", "bgd2_montagnes.png"))
s3 = pygame.image.load(os.path.join("resources", "bgd3_sol1.png"))
s4 = pygame.image.load(os.path.join("resources", "bgd4_sol2.png"))
s5 = pygame.image.load(os.path.join("resources", "bgd5_sol3.png"))
s6 = pygame.image.load(os.path.join("resources", "sprite_nuages1.png"))
s7 = pygame.image.load(os.path.join("resources", "sprite_nuages2.png"))
s8 = pygame.image.load(os.path.join("resources", "sprite_nuages3.png"))
s9 = pygame.image.load(os.path.join("resources", "sprite_nuages4.png"))
s10 = pygame.image.load(os.path.join("resources", "sprite_barriere.png"))
s11 = pygame.image.load(os.path.join("resources", "fireworks.png"))
s12 = pygame.image.load(os.path.join("resources", "sprite_arbre.png"))
s13 = pygame.image.load(os.path.join("resources", "scrolltext.png"))

music = pygame.mixer.Sound(os.path.join("resources", "remix.ogg")).play()
pygame.mouse.set_visible(False)

and then the main game loop.

There is no call in the same code to pygame.mixer(), so I added one as you suggested, and even tried it in several places, like after pygame().init, after the screen opening, after the call to start the music, and so on, changing only one line for each test, but had no luck. I checked out the webpage on the use of the mixer, and found there's a pre_init() call that can be used before pygame.init(). I even tried that, but it made no difference. I then decided to use Synaptic Package Manager to re-apply the libsdl mixer library, in case that was the problem. Still no luck.

By the way, as I mentioned in the original post, I'm using ubuntu Linux.

Any help would be much appreciated.

Thanks in advance,

Andrew.


Send instant messages to your online friends http://au.messenger.yahoo.com