1
from pygame import mixer

mixer.init()
mixer.music.load("music/Recording.mp3")
mixer.music.play(100) 

is what I'm using right at the start of game code (not in a loop). i have looked it up and cant find why it wont work

Glitchd
  • 361
  • 2
  • 12

1 Answers1

1

You have to wait while music will ends playing:

import pygame
from pygame import mixer

mixer.init()
mixer.music.load(r'music.mp3')
mixer.music.play(100)
while pygame.mixer.music.get_busy():
    continue
Alderven
  • 7,569
  • 5
  • 26
  • 38
  • This works for me. See for details: https://stackoverflow.com/questions/7746263/how-can-i-play-an-mp3-with-pygame – Alderven Mar 10 '19 at 09:51