-
Notifications
You must be signed in to change notification settings - Fork 7
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
loop returns Howl instance instead of bool #3
Comments
Looks like this is a bug in howler. Can you log this in https://github.com/goldfire/howler.js repo. |
Sure! Do I present this issue linked to the use of haxe-howler? I'll do Le jeu. 8 oct. 2015 13:57, Adi notifications@github.com a écrit :
|
May be if you look in the generated javascript file, you can find how the parameters are casted. Post the js file here if you can. |
The generated JS file is more than 2MB big in debug (HTML5 game). I would rather not post the whole file here, especially as it is for a client. |
howler calls may help |
SoundMng is the base class for playing sound. It just takes a Howl instance and plays it with some tweaking parameters. It can also load a sound directly from path. Nothing magical in here, just fyi as it is the base class dealing with Howler.
SoundManagerONI is child of SoundMng. This one is the interesting part, as it loads all the sound sprites and play them. I use enum values or string values to determine which sound to play. This part works quite well, I have no issues with it, I always retrieve the correct Howl instance for my needs.
The issue I found is located here, in an event callback (
In Does it help? |
yes, got it now... I think I know the issue. Will do a quick test and then update the externs. |
Fixed it @FlorianBT. Please check and let me know. v2.0.1 http://lib.haxe.org/p/howlerjs/2.0.1 Also updated the sample to trace the return value of |
Hello again. Sadly, my project doesn't compile anymore with your latest changes.
Involved lines in Haxe, in order:
I looked a bit at your new overloads and did some researches as I couldn't find a reason it selected the wrong overload. I found this : |
I see the problem and it's really annoying... anyway as a quick fix I changed the return type to Can you try again and let me know. v2.0.2 I did a quick test and it's fine. |
Tested, compiling and working as expected. Thanks a lot for your time! |
👍 |
I found out that Howl.loop returns a Howl object instead of a boolean value as expected
This would log the whole Howl object. In my case, this:
As you can see, the Howl instance itself is set to loop. Calling
audio.loop()
would returntrue
. But when passing a sound id, it returns the Howl instance.Tracking down what happens in the javascript code, my guess is that a type check "fails" in howler code.
Specifically this bit of code:
The id parameter of
loop()
is probably converted fromInt
toBool
as part of the optional parameters substitution.Thanks in advance for any quick fix :)
The text was updated successfully, but these errors were encountered: