Closed scribblecrumb closed 1 month ago
Hello!
I cannot reproduce this issue. I'm on Ubuntu 23.10 and using pygame-ce 2.4.1 (SDL 2.28.5, Python 3.11.6)
.
I tested with the music_drop_fade
example that comes along with the pygame-ce install.
Please provide a minimal reproducer that triggers the bug for you, more factors other than calling set_volume
may be involved in order to trigger this bug.
import random
import pygame
MYEVENT = pygame.USEREVENT + 1
class App:
def __init__(self) -> None:
pygame.init()
self.display = pygame.display.set_mode([320, 180])
path = "sample.mp3"
pygame.mixer.music.load(path)
pygame.mixer.music.play()
pygame.mixer.music.set_endevent(MYEVENT)
def check_events(self):
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
if event.type == pygame.KEYDOWN:
pygame.mixer.music.set_volume(random.randint(0, 100) / 100)
if event.type == MYEVENT:
print("myevent")
def update(self): ...
def render(self):
self.display.fill("white")
pygame.display.flip()
def run(self):
while True:
self.check_events()
self.update()
self.render()
if __name__ == "__main__":
a = App()
a.run()
Here is another sample I tested with (thanks to @pycoinfu for providing this) and I still cannot reproduce the issue. I am closing this issue for now, but feel free to re-open if you can write a similar script that reproduces the issue for you.
Environment:
Current behavior:
I set up a custom event to be triggered when the music ends via set_endevent.
I found that the MUSIC_END event was being triggered both when the music ends and when
pygame.mixer.music.set_volume
is used.Expected behavior:
I would expect for the endevent to only trigger when the music ends.
Screenshots
N/A
Steps to reproduce:
pygame.USEREVENT
pygame.mixer.music.set_endevent()
pygame.mixer.music.set_volume()
Test code N/A (i'll add one if i find time later to write one up)
Stack trace/error output/other error logs N/A