-
Notifications
You must be signed in to change notification settings - Fork 335
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
test_sound_normal_load_and_playback error on MacOS #2533
Comments
One more sound-related issue I noticed on MacOS is that sound playback like this: import time
import arcade
s = arcade.load_sound(":resources:sounds/coin1.wav")
arcade.play_sound(s)
s.play()
time.sleep(3) at the end of the playback will crash like this (the time.sleep is to avoid Python exit before the sound finishes):
When playing the sound like this it works fine (no crash): class TheView(arcade.Window):
def __init__(self):
super().__init__()
self.coin_sound = arcade.load_sound(":resources:sounds/coin1.wav")
def on_update(self, delta_time):
# arcade.play_sound(self.coin_sound)
self.coin_sound.play()
time.sleep(10)
view = TheView()
view.run() Is this a bug or something to improve? Or is playing sound like that illegal and should simply be avoided? |
Stalling the event loop or not having an event loop running is not recommended when playing sound with pyglet / arcade because the sound thread needs to keep refilling the sound buffers periodically. It's probably something we should mention in docs. |
The
test_sound_normal_load_and_playback
fails on MacOS (see full output below) with Python 3.13.Can this be fixed or Is OGG not supported on MacOS?
Suggestion: remove the try/except here in
load_sound
:arcade/arcade/sound.py
Lines 242 to 247 in 333ce6e
Forcing the exception to change type to
FileNotFoundError
is incorrect and thus confusing in this case. It's also not necessary since theSound(...)
init will raise aFileNotFoundError
already if the file isn't there.Would it be easy / desired to add MacOS testing to Github CI?
The text was updated successfully, but these errors were encountered: