SoundChannel can’t be controlled immediately. For example, the actual effect of the following code is that sound still plays in the background. sound.play().stop();
The interval duration between repeated sounds is longer. sound.play(0, 100);
Sometimes the sound is intermittent and the position of SoundChannel instance is inaccurate.
Yes, everything is because of the library of howler.js.
Because it has too many unmanaged setTimeout inside, it often causes sound play repeat unexpectedly and the SoundChannel out of control.
The temp solution is to modify:
to
var isplaying = true;
if (self._queue.length > 0)
{
var last_queue_event = self._queue[self._queue.length - 1].event;
if (last_queue_event == 'stop' || last_queue_event == 'pause')
{
self._queue.splice(0, self._queue.length - 1);
isplaying = false;
}
}
if (isplaying)
{
self._emit('play', sound._id);
}
I think howler.js is not suitable for openfl project at all, it leads to many issues.(Sorry to the author, but it is the truth. )
How about rebuilding the Howl class? I am willing to make some contribution for it.