play music using pygame but no sound

后端 未结 5 1275
情书的邮戳
情书的邮戳 2020-12-16 02:47
import pygame
pygame.mixer.init()
pygame.mixer.music.load(\"only one.mp3\")
pygame.mixer.music.play(0)
while pygame.mixer.music.get_busy():
    pygame.time.Clock().t         


        
5条回答
  •  没有蜡笔的小新
    2020-12-16 03:00

    it would be easier if u changed the mp3 to ogg format ,try this.. its simple

    from pygame import *
    pygame.init()
    pygame.mixer.music.load("only one.ogg")
    pygame.mixer.music.play(-1)
    pygame.mixer.music.set_volume(0.3)
    

    vote the answer if its working, if not tell me whats wrong

提交回复
热议问题