Answers for "how to play music in pygame"

3

How to play music without pygame

from playsound import playsound
playsound('audio.mp3')
#Hope it helps :)
Posted by: Guest on March-09-2021
4

pygame music player

import pygame

pygame.init()
pygame.mixer.play('datei.wav')
Posted by: Guest on February-22-2021
0

how to put song in pygame

#has to be in .mp3 format
#has to be in same folder
#load the music
pygame.mixer.music.load('song.mp3')
#play the music infinite
pygame.mixer.music.play(-1)
#or play it one time
pygame.mixer.music.play(0)
Posted by: Guest on May-15-2020

Python Answers by Framework

Browse Popular Code Answers by Language