This raises the following error: TypeError: Sound.is\_complete () missing 1 required positional argument: 'player'
Now, if my reading of the arcade docs is correct, ball\_sound.play() returns a player object. arcade.Sound.is\_complete () requires only 1 argument, and that's a player object. So I'm not sure why the error is happening considering I'm passing in a player object.
What's interesting though, I eventually got annoyed enough that I just said "Fine, If you want an additional argument, you can have one". So I rewrote
For some reason, this fixed the TypeError, which makes no sense to me considering I'm passing in 2 arguments when is\_complete() asks for exactly 1. The program even compiles and runs for a bit! Well, until the sound finishes playing in which case the following error occurs.
Traceback (most recent call last): File "c:\Projects\test.py", line 16, in <module> arcade.run () File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\arcade\window_commands.py", line 152, in run pyglet.app.run(None ) File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyglet\app\__init__.py", line 81, in run event_loop.run(interval) File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyglet\app\base.py", line 164, in run timeout = self.idle() ^^^^^^^^^^^ File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyglet\app\base.py", line 232, in idle self.clock.call_scheduled_functions(dt) File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyglet\clock.py", line 217, in call_scheduled_functions item.func(now - item.last_ts, *item.args, **item.kwargs) File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\arcade\application.py", line 545, in _dispatch_frame self._dispatch_updates(delta_time) File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\arcade\application.py", line 579, in _dispatch_updates self.dispatch_event("on_update", GLOBAL_CLOCK.delta_time) File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyglet\window\__init__.py", line 686, in dispatch_event super().dispatch_event(*args) File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyglet\event.py", line 364, in dispatch_event if handler(*args): ^^^^^^^^^^^^^^ File "c:\Projects\test.py", line 11, in on_update if arcade.Sound.is_complete(self.sound,self.sound): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\my_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\arcade\sound.py", line 171, in is_complete return player.time >= self.source.duration # type: ignore ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'duration'