Skip to content

Commit 59cdf90

Browse files
committed
Fix double looping sound
1 parent 94b247c commit 59cdf90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/howler.core.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,9 +1466,14 @@
14661466

14671467
if (self.playing(ids[i])) {
14681468
// Buffer needs to be refreshed if an active audio is playing as some browsers, like Firefox, will not loop otherwise
1469+
if (typeof sound._node.bufferSource.stop === 'undefined') {
1470+
sound._node.bufferSource.noteOff(0);
1471+
} else {
1472+
sound._node.bufferSource.stop(0);
1473+
}
1474+
14691475
self._refreshBuffer(sound);
14701476

1471-
// Play the sound using the supported method.
14721477
if (typeof sound._node.bufferSource.start === 'undefined') {
14731478
sound._node.bufferSource.noteGrainOn(0, self.seek(ids[i]), 86400);
14741479
} else {

0 commit comments

Comments
 (0)