goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.87k stars 2.23k forks source link

sound.loop error #1442

Closed zxm1985 closed 3 years ago

zxm1985 commented 3 years ago

I'm using it sound.loop (true, soundid); has no effect when it is used. First let soundid = sound.play (); after setting sound.loop (true, soundId); Once it was played, it was suspended. The problem was in the firebox desktop. Other browsers were normal.

logaoleg commented 3 years ago

Have the same issues. Only Firefox ^84.0 is affected

themoonrat commented 3 years ago

Here too. Firefox is the only effected out of the browsers on my Windows machine

Load up https://howlerjs.com/assets/howler.js/examples/sprite/ in Firefox Then in console, type in as one command

var id = Howler._howls[0].play('one');
Howler._howls[0].loop(true, id);

Loops everywhere about from Firefox, now. Seems a recent thing.

Looping on Firefox with Phaser 3 works fine: http://labs.phaser.io/edit.html?src=src\audio\Web%20Audio\Loop%20Delay.js

And when using https://mdn.github.io/webaudio-examples/decode-audio-data/ as a raw WebAudio implementation, looping works fine on Firefox.

@goldfire - So seems to be something within Howler.... but that's worked for ages until recently :/ Both 2.2.1 and 2.2.0 have this issue. Will investigate back further shortly

themoonrat commented 3 years ago

2.1.x series also does not work But 2.0.x series does work in Firefox

themoonrat commented 3 years ago

Drilling down even further for latest version.... Checkout the repo, and get the 'sprite' example running - but add self.sound.loop(true, id); on line 73. So after you play a sound, it'll loop.

The first sound you click on will loop correctly in Firefox... but any subsequent presses will not loop

themoonrat commented 3 years ago

This is because when you go through looping via '_refreshBuffer' - looping works fine. But if you go via 'loop', it does not, on Firefox, for some reason

irongaze commented 3 years ago

+1 - Causing issues on my WebGL-based game platform.

arilotter commented 3 years ago

+1 Causing issues in our WebGL-based game too.

fagn88 commented 3 years ago

+1 Causing issues in our application

goldfire commented 3 years ago

Fixed with #1445.