pythonpygamemixer

How to start music at a specific second in Pygame


I was looking at the API:

http://www.pygame.org/docs/ref/music.html#pygame.mixer.music.play

It says I can start the song at a certain position. However, 1 of 2 things happen. Either the song plays normally from the start or it plays really fuzzy-like. I'm not sure why I can inconsistent results either.

pygame.mixer.music.load("music/Glorious Morning 2.mp3")
#pygame.mixer.music.set_pos(52.0)#this won't work either
pygame.mixer.music.play(-1, 52.0)

I'm not sure why it's not working. Am I doing something wrong? Is there another way to start music at a specific second?


Solution

  • My Python version is 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]. I'm not sure what Pygame version was, but I just updated both Python and Pygame and it worked!