Playing music in python with pygame -


i've been trying play music pygame , far i've gotten work code (this entire script way):

import pygame pygame.init() screen = pygame.display.set_mode((1,1)) pygame.mixer.music.load("backinblack.mp3") pygame.mixer.music.play(-1, 0.0) while pygame.mixer.music.get_busy: continue 

however when remove line:

 screen = pygame.display.set_mode((1,1)) 

the program loops forever not play song. know way around this? end goal create gui uses pygame playing of music. know trivial answers on stackoverflow similar questions have involved inserting while loop 1 have, doesn't seem trick itself.

i don't know how bypass that, have considered using sdl mixer?


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

c++ - Accessing inactive union member and undefined behavior? -

php - Get uncommon values from two or more arrays -