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

Re: [pygame] Poor sound



Rene Dudfield wrote:

Bo Jangeborg wrote:


Im currently looking into converting a smal free strategy
game to pygame. One thing that I have noted is that the
sound output from the mixer is rather poor even if you
preinitialize it to correct values. Is this a problem
that is being looked into by the SDL group ?



what sort of 'poor' do you mean? latent? scratchy?

while i wouldn't call the SDL sound stuff wide featured, it does run well enough for games with a controlled set of data. it is the same sound engine used in nearly all linux games.

The sound get slightly distorted and scratchy. I have sound of a gong (44000 16bit Stereo)) that gets spikes, If I play
the same sound but using the winsound module it sounds perfect, but then I can only play one sound at a time.
I don't know if this is an issue with NT W2K and XP, but anyway it doesn't sound good. It may work better under Linux but I haven't
got a working Linux desktop right now.

Btw I have used pygame.mixer.pre_init(44100, -16) . How do you know whether to use -16 or 16, not that I can hear any differens.

You can download the gong sound from
http://www.softwave.se/filer/gong.wav
http://www.softwave.se/filer/gong.ogg

I have scratchy sound on windows XP too. pre_init with the args below fixes the scratchy sounds. But the latency in increased a little too much for some.
pygame.mixer.pre_init(44100,-16,2, 1024 * 3)

Thanks that solved it :) , is there some documentation on the buffer values somewhere ?