Answers for "pygame play mp3"

7

pygame play sound

import pygame

pygame.mixer.init()
crash_sound = pygame.mixer.Sound("crash.wav")
crash_sound.play()
Posted by: Guest on July-14-2020
0

how to play mp3 file form pygame module

from pygame import mixer
    water_song = "water.ogg"
    mixer.init()
    mixer.music.load(water_song)
    mixer.music.play()
Posted by: Guest on September-28-2021

Python Answers by Framework

Browse Popular Code Answers by Language