Support webp, mp3 etc
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 611
- Forks
- 211
- PR merge metrics
- No merged PRs in 30d
Description
Since [Pygame 2.0.0](https://github.com/pygame/pygame/releases/tag/2.0.0) Pygame has supported a wider range of formats including webp for images and mp3 for audio.
pgzero initially restricted support for mp3 in order to ensure cross-platform compatibility.
We can now relax this and add support for more of the image and audio formats supported in Pygame. This will only require changes to the file extensions listed in [loaders.py](https://github.com/lordmauve/pgzero/blob/main/src/pgzero/loaders.py#L175), but also tests.
I think the relevant set is:
- [X] WebP images
- [ ] MP3 audio
- [ ] FLAC audio
- [ ] 32-bit WAV
Others (PNM, TIFF) are niche.
SVG is available in Pygame but the implementation (nanosvg) has major limitations, with no support for text rendering, gradients, filers, or antialiasing. [resvg_py](https://pypi.org/project/resvg-py/) would be a better implementation for this, more complete and more stable. But the project doesn't look very mature. Because it uses unstable ABI wheels it would become uninstallable on newer interpreters if maintenance dried up.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/pgzero/loaders.py, where the supported file extensions are listed, and inspect the existing tests for loader format support. Add coverage for the remaining MP3, FLAC, and 32-bit WAV formats, then run those tests. Done means the supported formats work consistently with the Pygame versions targeted by the project.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100