sounds aren't played at the expected moment

Issue #89 resolved
Former user created an issue

You can check this with the example 3 from this archive:

The sounds are played erratically: 3 sounds at a similar interval, then the fourth at a different interval. And yet the orders are sent regularly: I checked this by printing the time to the console.

I noticed this with pygame 1.9.2-pre and Python 2.7 (Windows XP). The problem doesn't appear with pygame 1.7.1 and Python 2.5 (Windows XP) and pygame 1.7.1 and Python 2.4 (Linux Xandros for eeePC).

similar problem: I noticed (in this example or a similar, I can't remember for sure) that orders to stop a sound were ignored. Sounds were queued to the channel instead of interrupting the previous one.

Comments (3)

  1. Former user Account Deleted

    I did the same test with pygame 1.8.1release and Python 2.6.6 (Linux Debian 6.0.4 stable) and the problem doesn't appear.

  2. bitcraft1

    With pygame 1.9.1 and python 2.7 on my OS X lion macbook, the sounds are also not played 'at the right time'. They are often delayed, or in the case when they should be overlapping, they are played in sequence.

  3. Michael Rochester

    We have found that the default buffer length is quite large, and this can cause a delay in the sound output. Try shortening your buffer with the pygame.mixer.pre_init(22050,-16, 2, 1024) command. the final parameter is the buffer size so if you are still having issues make it even smaller.

    This command must go above pygame.init().

  4. Log in to comment