lordmauve / lordmauve/pgzero

Delay before sounds played

Open
#112 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
611
Forks
211
PR merge metrics
No merged PRs in 30d

Description

When playing a sound (wav and ogg) from the 'sounds' directory using:
`sounds.soundname.play()`
there is a noticeable delay (.5 sec) before the sound is played.
This also happens in Pygame when using:
```
effect = pygame.mixer.Sound('sounds/soundname.wav')
effect.play()
```
With Pygame the delay is removed by using:
```
pygame.mixer.pre_init(22050, -16, 1, 256)
pygame.mixer.init()
```
before pygame.init()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the sounds.soundname.play entry point and how the framework initializes Pygame's mixer. Compare that setup with the pygame.mixer.pre_init and pygame.mixer.init sequence shown in the report. Done means WAV and OGG playback no longer has the reported half-second delay, with sound playback still working.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.