Closed sgrund14 closed 4 years ago
So for example, if I call GameAudio.play('move'), it will play move, then move_blocked, then switch_toggle.
What browser are you testing this in? I'm unable to reproduce this in my own testing, but I may be doing something differently.
Google Chrome!
Same here on MAC OS X with Google Chrome and FireFox. On Safari it doesn't even play ("onplayerror" is triggered) when setting html5 to true.
I'm new to the codebase, but I've found out, that the following line is evaluating to true (regarding the comment it should only evaluate to true for IE with network latency), and this is causing that the _ended callback is triggered forever, so the sound/sprite is never stopped from playing:
https://github.com/goldfire/howler.js/blob/master/src/howler.core.js#L1711
I don't know how to fix it right now without introducing another edge case, so I haven't created a pull request yet.
got the same issue, and yes, you have to do something inside the if
condition, otherwise _ended
will get restarted over and over again till your whole sprite file comes to an end. The following solves the immediate issue for now:
// If we are using IE and there was network latency we may be clipping
// audio before it completes playing. Lets check the node to make sure it
// believes it has completed, before ending the playback.
if (!self._webAudio && sound._node && !sound._node.paused) {
self.stop(sound._id, true);
setTimeout(self._ended.bind(self, sound), 100);
return self;
}
Me too! if html5: true, duration delay 500ms!!!
I have same issue when I try to use some mp3 file which has duration larger than 1 min.
Closing due to inactivity. If this is still an issue, reply with more info and I'll reopen.
Closing due to inactivity. If this is still an issue, reply with more info and I'll reopen.
more info
this still reproduces even with the latest versions of howler 2.2.3 and 2.2.4
Sprites are playing longer than they should when using html5 audio.
Initializing howl like this:
AudioInfo looks like this:
spriteMap passed into Howl looks like this:
Getting duration for the howl by using (sprite.end - sprite.start) * 1000.
While the duration of each sprite is correct using duration(), it plays for longer than that, resulting in extra sprite sounds being played.
The start time for the sprite is also correct.
What's curious is, when I set html5: false, the duration is as long as it should be, and no extra sprites are played.
Generating GameAudio using audiosprite.