我正在使用代码:
import pygame, sys, datetime
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640, 480))
screen.fill((0, 0, 0, 255))
pygame.display.set_caption("TESTIFICATE")
if datetime.date.today().month == 12 and datetime.date.today().day == 25:
pygame.mixer.music.load("8bit-jingle-twist.mp3")
print("Merry Christmas!")
else:
pygame.mixer.music.load("timeless-mountains.mp3")
print("Loading Music...")
pygame.mixer.music.play(-1, 0.0)
print("Playing Background Music...")
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
两者都8bit-jingle-twist.mp3
存在timeless-mountains.mp3
并且可以由 VLC 播放。我的音量开着,我的困惑也开着。