0

so I`ve been trough all the answers here and other websites, to find out a solution to this issue, even tried using the codes from the users answers but it ends the same way, it runs smoothly but no music is played. I read in some of the comments that it might be related to the OS win 11, that it used to work on the previous OS before. All the questions and answers are dated quite long ago, so anyone knows a way to make it work? Thank you. My code and the ones I tested will be bellow.Python version 3.2, and pygame 2.1.2.

import pygame
pygame.mixer.pre_init(44100, -16, 2, 2048)
pygame.init()
pygame.mixer.music.load("021ex.mp3")
pygame.mixer.music.play(-1)
pygame.event.wait()

-------------------------

import pygame
pygame.init()

pygame.mixer.music.load('021ex.mp3')
pygame.mixer.music.play()

clock = pygame.time.Clock()
while pygame.mixer.music.get_busy():
    clock.tick(60)
    pygame.event.poll()

------------------------------

import pygame
pygame.mixer.pre_init()
pygame.init()
pygame.mixer.music.load("021ex.mp3")
pygame.mixer.music.play()
pygame.event.wait()

This last one is the one used on the video class that I was watching and it worked perfectly, but the class is from years back as well. Thank you in advance, looking forward for your help.

Vinnih
  • 1

0 Answers0