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

Re: [pygame] Choppy sound playback



Chris Smith wrote:
Help! I'm getting very choppy sound playback on my code. Here's a quick example:

#!/usr/bin/python

import pygame

pygame.init()
pygame.mixer.init (44100,-16,True,4096)
foo=pygame.mixer.Sound("sound.ogg")
foo.set_volume(1)
foo.play()

Sound plays, but like a very dirty record, with lots of digi-noise. Sound on other programs works fine; any obvious issues that anyone can think of?

-- Chris
--
Science is open source religion


Try the following:

pygame.mixer.quit()
pygame.mixer.init(44100, -16, 2, 4096)

That third parameter should be 1 for mono, and 2 for stereo.

If that still doesn't do it for you, try turning the volume down to .5 on the channel.

--Kamilche