-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I think I might've found an issue
I had this code:
def play_file(file: str, playback: bool):
global playback_device
path = os.path.join(os.getcwd(), file)
if not (os.path.exists(path)):
print(f'No file found at path \'{path}\'')
print('Cannot play file.')
return
mixer.music.load(file)
mixer.music.play()
if playback:
if playback_device is not None:
playback_device.close()
try:
playback_device = AudioPlayer(file)
playback_device.play()
except audioplayer.abstractaudioplayer.AudioPlayerError as e:
print('Failed to start playback')
print(e)When I called the function multiple times I got this error:
Failed to play "...\out.wav", code 289
(I modified the error message a bit to also show the error code)
I did some digging around and the error is apparently because there can be 2 aliases which are the same...?
I don't really know how that works but the problem seems to be with this code:
def __init__(self, filename):
super().__init__(filename)
self._alias = "A{}".format(id(self))and the fact id() can return the same values if the lifespans aren't overlapping or smth?
I haven't managed to reproduce the error, sorry
And also this is my first time reporting an issue on GitHub so sorry if I did something bad or wrong
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels