The shared voice limit between chip effects and the bus's 'se' jingles: both ask here before
they sound, and when the limit is reached the lowest-priority voice (the oldest among equals)
is cut for a new one of equal or higher priority; a new one below everything sounding is
refused. One arbiter handed to a bus and to every SfxSound makes them a single pool.
Example
import { SfxArbiter } from'@datamoc/mwg/audio';
constarbiter = newSfxArbiter({ maxVoices:2 }); consta = arbiter.request(1, () =>console.log('a cut')); arbiter.request(1, () =>console.log('b cut')); arbiter.request(5, () =>console.log('c cut')); // cuts a, the oldest of the lowest priority a?.release();
Asks for a slot. stop cuts the voice when a better one needs its place; active says
whether it still sounds, so a voice that ended by itself frees its slot for any asker, not
only for the sound that owned it.
The shared voice limit between chip effects and the bus's
'se'jingles: both ask here before they sound, and when the limit is reached the lowest-priority voice (the oldest among equals) is cut for a new one of equal or higher priority; a new one below everything sounding is refused. One arbiter handed to a bus and to everySfxSoundmakes them a single pool.Example