From: yu <kkndyu@xxxxxxxxx>
To: pygame-users@xxxxxxxx
Sent: Thu, March 25, 2010 3:20:01 AM
Subject: Re: [pygame] play sound
delay
thanks, Ian
now I know the key is the size of buffer, The smaller, the less
latency it will ...
I'm new to the coding of sound ... :(
2010/3/25 Ian Mallett <
geometrian@xxxxxxxxx>:
> Hi,
>
> Add the following line:
> pygame.mixer.pre_init(frequency=22050, size=-16, channels=8, buffer=256)
>
> Immediately after these lines at the beginning of your file:
> import pygame
> from pygame.locals import *
>
> And before:
> pygame.init()
>
> So:
> import pygame
> from pygame.locals import *
> pygame.mixer.pre_init(frequency=22050, size=-16, channels=8, buffer=256)
> pygame.init()
> #Rest of your code
>
> Ian
>