-
Notifications
You must be signed in to change notification settings - Fork 352
arcade.Sound.stop() doesn't work #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm guessing the sound was already removed by the @Cleptomania have any thoughts on this? Lines 57 to 72 in a042093
|
That probably is what’s happening. I think just checking if it’s in the list would be enough to prevent it from happening. We shouldn’t need to perform the check within |
It might as well go in |
I've pushed a fix for this to |
Also found that this example hasn't been updated to work with the new sound changes either and had some other unrelated issues. I'm going to update that as well. |
2.5.7 is released |
Bug Report
Actual behavior:
Exception:
File "venv/lib/python3.9/site-packages/arcade/sound.py", line 72, in stop
media.Source._players.remove(player)
ValueError: list.remove(x): x not in list
Expected behavior:
Sound is going to stop playing
Steps to reproduce/example code:
Launch: https://arcade.academy/examples/background_music.html#background-music and wait until end of first song :-)
Enhancement request:
What should be added/changed?
What would it help with?
Documentation request:
What documentation needs to change?
Where is it located?
arcade/sound.py
What is wrong with it? How can it be improved?
ValueError: list.remove(x): x not in list
Trackback from background-music example:
Traceback (most recent call last):
File "test.py", line 105, in
main()
File "test.py", line 101, in main
arcade.run()
File "venv/lib/python3.9/site-packages/arcade/window_commands.py", line 240, in run
pyglet.app.run()
File "venv/lib/python3.9/site-packages/pyglet/app/init.py", line 107, in run
event_loop.run()
File "venv/lib/python3.9/site-packages/pyglet/app/base.py", line 167, in run
timeout = self.idle()
File "venv/lib/python3.9/site-packages/pyglet/app/base.py", line 237, in idle
redraw_all = self.clock.call_scheduled_functions(dt)
File "venv/lib/python3.9/site-packages/pyglet/clock.py", line 292, in call_scheduled_functions
item.func(now - item.last_ts, *item.args, **item.kwargs)
File "venv/lib/python3.9/site-packages/arcade/application.py", line 223, in _dispatch_updates
self.dispatch_event('on_update', delta_time)
File "venv/lib/python3.9/site-packages/pyglet/window/init.py", line 1333, in dispatch_event
if EventDispatcher.dispatch_event(self, *args) != False:
File "venv/lib/python3.9/site-packages/pyglet/event.py", line 415, in dispatch_event
if getattr(self, event_type)(*args):
File "test.py", line 94, in on_update
self.music.stop(self.current_player)
File "venv/lib/python3.9/site-packages/arcade/sound.py", line 72, in stop
media.Source._players.remove(player)
ValueError: list.remove(x): x not in list
The text was updated successfully, but these errors were encountered: