[HTML5] howler bug?

Hi,
I am using the latest libs (Lime 7.1.1 + Openfl 8.6.4) and sometimes, randomly I have crashes related to howler, or simple errors that don’t arrest the execution of the application (?!). The latest log I received is this one

Error: Failed to execute 'stop' on 'AudioScheduledSourceNode': cannot call stop without calling start first.
    at o.pause (howler.min.js:2)
    at e (howler.min.js:4)
    at o.Howl.pos (howler.min.js:4)
    at lime__$internal_backend_html5_HTML5AudioSource.setPosition (HTML5AudioSource.hx:307)
    at lime__$internal_backend_html5_HTML5AudioSource.play (HTML5AudioSource.hx:72)
    at lime_media_AudioSource.play (AudioSource.hx:71)
    at new openfl_media_SoundChannel (SoundChannel.hx:107)
    at openfl_media_Sound.play (Sound.hx:509)
...

What does this mean? Does it mean that howler doesn’t handle the exeption of a stop on a non-playing sound?

Well, it is not so reproducible for me :expressionless:
Uh, so I have to use that howler version… thanks!

Let us know how a different version works if you use one :blush:

If I only knew how to trigger the error, in my case it doesn’t behave like in the description.

How do I replace howler.min.js with howler.core.js?

You can manually put it into html5/bin/lib folder and change index.html to load howler.core.js instead of howler.min.js.
Or you can create a template Index.html template (your topic).

When running the app it tells me “ReferenceError: Howl is not defined”.
If it worked, .core is 770kb against the 32kb of .min :neutral_face:

Any suggestion? How do I replace the default howler.js?

Replace the contents of howler.min.js in the Lime “dependencies” directory. That’s the simplest way to test it.

If it works, then we can minify and update our standard copy for everyone :slight_smile:

i had the same isshue. Replaced howler.min.js content with ‘howler.core.js’ and problem was fixed.

InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable howler.min.js:2
pause ***howler.min.js:2:10497
e ***howler.min.js:4:9171
Howl.prototype.pos ***howler.min.js:4:3754
setPosition HTML5AudioSource.hx:307:78
play HTML5AudioSource.hx:72:2
play AudioSource.hx:71:2
openfl_media_SoundChannel SoundChannel.hx:107:3

I have compiled replacing min with core in the dependencies folder, but now I get this message in the console

Uncaught SyntaxError: Unexpected token < howler.min.js:7

as core content is an html, not a js, right?

No, howler.core.js should be a JS file. On Github, you may need to click the file, then click and save the “Raw” link to get the pure text

Also, guys, if anyone has a chance to test on IE11, would be great to know if the stock version of Howler works so far, or if we still need our patch: https://github.com/goldfire/howler.js/pull/1052

I can test on IE. With the latest fix (howler.core.js) it works fine.
Or do you want to test with another version?

Yeah, if latest Howler dev version is stable on IE11, we can minify it and include it in Lime :slight_smile:

1 Like

Ok, now it works, I will try to understand if the problem is fixed, but listening to others it should.

Version 2.1 of Howler is out.

I’d suggest using howler.core, not howler full, as it has cleaner sound (I don’t know why) and no odd bugs in Firefox which I had with howler full 2.0.15.

Cleaner sound? Really? I noticed that the bugged version had a problem with frequencies, maybe you are referring to that problem.

Maybe it’s the positional sound plugin? I believe we do enable sound panning when that’s available

The core version fixes it, is it missing the auto-enabled panning?

Maybe take a look here:

It’s pretty similar to the same method in the NativeAudioSource type: https://github.com/openfl/lime/blob/8c7c9d78832fcb8c19e4832b97cbdcb14e6b984b/src/lime/_internal/backend/native/NativeAudioSource.hx

Ooh, maybe the issue is the soundTransform setter in here:

Perhaps that should not apply on HTML5?