Adding music to games

pygame allows you to add music to your games. There is a music module that allows you to add music in a few formats to your game files. There are some limitations, including file types. For example, using universally supported .ogg file types is better than using file types such as .mp3, which are not natively supported on all operating systems.

Note

For more information, you can go to the pygame site at https://www.pygame.org/docs/ref/music.html and learn how to add your favorite sounds.

Get Python Projects for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.