enablePooling method

void enablePooling({
  1. bool enabled = true,
  2. int poolSizePerSound = 4,
  3. int minPlayersPerSound = 1,
})

Enable/disable pooling and configure pool sizes.

  • When enabled=false, calls to playPooled/playPooledPath fall back to the channel’s single player (playFromSource), i.e., no overlap.
  • Size changes affect newly created pools. Existing pools keep their size until rebuilt (see refreshPoolsAudioContext).

Implementation

void enablePooling({
  bool enabled = true,
  int poolSizePerSound = 4,
  int minPlayersPerSound = 1,
}) {
  _poolingEnabled = enabled;
  _poolSizePerSound = poolSizePerSound.clamp(1, 16);
  _minPlayersPerSound = minPlayersPerSound.clamp(1, _poolSizePerSound);
}