A sound effect, pooled so the same clip can overlap itself. A dozen arrows landing in the
same second must not cut each other off, which a single <audio> element would - the
next play just steals the oldest of the pool, round-robin, rather than restarting the one
already mid-sound.
Example
import { Sound } from'@datamoc/mw_games/audio';
consthit = newSound('sounds/hit.mp3', { poolSize:6, caption:'a sword strikes' }); hit.play(); // safe to call several times in the same second
A sound effect, pooled so the same clip can overlap itself. A dozen arrows landing in the same second must not cut each other off, which a single
<audio>element would - the next play just steals the oldest of the pool, round-robin, rather than restarting the one already mid-sound.Example