Working on a Raspi 3 A+ with default Raspbian OS, I am trying to figure out why Pygame has stopped cooperating. I am trying to load a song, play it, and keep track of where I am within the song.
Previously this (stripped down to remove anything non-pygame related) has worked fine
import Pygame
pygame.mixer.init()
pygame.mixer.music.load("/home/pi/Desktop/my file.mp3")
while True:
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
#do stuff using pygame.mixer.music.get_pos()
I am finding in the REPL that it seems that pygame is not loading music. When I run
>>> import pygame
>>> pygame.mixer.init()
>>> pygame.mixer.music.play()
>>> pygame.mixer.music.get_pos()
the last call returns -1
I have examined related posts and have tried suggestions there including pre-initializing pygame, to no avail. Am I best off creating a fresh image of Raspbian?