I have a problem with my python audio player. I use this function to pause the music that is playing:
def pause(event):
global time
pygame.mixer.music.pause()
time=pygame.mixer.music.get_pos()
And then,I'm trying to play it again from the position where it's stops with this function:
def play(event):
global time
name=listbox.get(ACTIVE)
file="music/"+str(name)
mixer.music.load(file)
pygame.mixer.music.play()
if time >0:
pygame.mixer.music.set_pos(time)
mixer.music.play()
else:
mixer.music.play()
But after that I get this error:
pygame.error: set_pos unsupported for this codec
Also I tried pygame.mixer.music.unpause()
function:
def play(event):
global time
name=listbox.get(ACTIVE)
file="music/"+str(name)
mixer.music.load(file)
if time >0:
mixer.music.unpause()
else:
mixer.music.play()
But it is simply not working, no errors at all in this case. I use python 3.6 and pygame 1.9.3 on Windows 10(64 bits).