Skip to main content

SoundPool

@0.1.0 · deprecated
Deprecated

No longer maintained. It works but has not kept up with Roblox's newer audio API.

A pool of positional Sound parts for rapid-fire SFX, such as hits in a fighting game.

SoundPool keeps a minimum and maximum number of parts with a Sound each, hands one out for every PlaySound, and returns it to the pool when playback finishes. Each playback is an object you can pause, resume, stop or reconfigure. Built on frqstbite's object-pool.

Use it when​

  • You play many short positional sounds per second and want to cap instance churn.

Install​

Studio Wally​

Using the Studio Wally plugin:

  1. Open the widget.
  2. Search kashtheking/sound-pool.
  3. Press download and choose Shared module (recommended for almost every package).

Wally​

Add this to the [dependencies] section of your wally.toml, then run wally install:

SoundPool = "kashtheking/sound-pool@0.1.0"
local SoundPool = require(ReplicatedStorage.Packages.SoundPool)

Dependencies​

Wally installs these automatically:

Credits​

Trove and Signal are by sleitnick (RbxUtil); object-pool is by frqstbite.

API​

Every constructor, method, property and type is documented on the SoundPool API page, generated from the doc comments in init.luau. Each entry links to its line in the source.

Help​

Questions and bug reports: the Discord or a GitHub issue. See Help & contact for everything else.