-
Notifications
You must be signed in to change notification settings - Fork 336
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
Sound only plays for a frame #1068
Comments
From the way you describe it it seems more like a Haxe MainLoop issue, I'm moving this on Haxe repo |
Ah, can't transfer outside of heapsio group, so please reopen on http://github.com/haxeFoundation/haxe and post the link there, thanks. |
Also please try with a build from https://build.haxe.org/, there have been a few fixes for MainLoop since 4.2. |
created the issues at HaxeFoundation/haxe#10682 As I was typing out the issue in haxe issues, I think the main problem may not be related to the main loop, at least from my understanding. It makes sense for the SoundManager not blocking the termination of the MainLoop, but I think it is necessary for one of the updates in MainLoop to at least block the termination. For example https://github.com/HeapsIO/heaps/blob/master/hxd/System.hl.hx#L462-L463 |
I tried 4.2.5, the problem is still there. As mentioned, I don't think MainLoop has any issue. I think we just need a core update to block mainloop from exiting. |
minimum code https://github.com/ZwodahS/heaps-sound-bug
OS : Mac
heaps version: 57c1bd3
haxe: 4.2.4
SoundManager set isBlocking to false.
https://github.com/HeapsIO/heaps/blob/master/hxd/snd/Manager.hx#L151
Main loop cancel the event and only adds it back when there is a blocking event.
https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/MainLoop.hx#L81-L89
https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/MainLoop.hx#L124
This is fine when live update is set to true
hxd.res.Resource.LIVE_UPDATE = true;
(suspect that the live update created a blocking main event) or when you have mainEvent elsewhere.with that, there is 2 solutions that I found that works
https://github.com/ZwodahS/heaps-sound-bug/blob/main/App.hx#L4-L5
However, I am curious as to what is the best way to handle this, and if this is considered a bug.
The text was updated successfully, but these errors were encountered: