SoundUtils - A comprehensive and easy set of Sound Utility Tools!
Introduction - What is SoundUtils?
SoundUtils is a powerful utility-type sound management library that simplifies audio handling in your code. It provides clean and intuitive APIs for sound creation, profile-based configuration, batch preloading, and advanced playback control.
Features
- Sound Profiles - Create reusable sound configurations
- Batch Preloading - Load multiple sounds efficiently with progress tracking
- Flexible Creation - Create sounds from configs, profiles, or combinations
- Advanced Playback - Sync, async, and callback-based playback methods
- Auto-cleanup - Optional automatic sound destruction after playback
- Type-Annotation Support - Full type definitions for better dev experience
Basic Usage
The usage of SoundUtils varies based on what you want, but it follows a utility module pattern.
From basic sound creation, to reusable profiles and preloading, *SoundUtils has it.
Sound Creation:
local SoundUtils = require(path.to.SoundUtils)
-- Creating a simple sound!
local sound = SoundUtils.create({
SoundId = "rbxassetid://12345678",
Volume = 0.8,
Parent = workspace
})
-- Play it
SoundUtils.play(sound)
Using Sound Profiles:
-- Create a profile for UI sounds
local uiProfile = SoundUtils.newProfile({
Name = "UIProfile",
Volume = 0.6,
PlaybackSpeed = 1.2,
RollOffMode = Enum.RollOffMode.InverseTapered
})
-- Create sounds using the profile
local clickSound = SoundUtils.createFromProfile("UIProfile", {
SoundId = "rbxassetid://12345678",
Name = "ClickSound"
})
Extremely helpful for a modular design!
Batch Preloading:
-- Create a preloader
local preloader = SoundUtils.newPreloader()
-- Add sounds to preload
preloader:Add("rbxassetid://12345678", "BackgroundMusic", "MusicProfile")
preloader:Add("rbxassetid://87654321", "JumpSound", "SFXProfile")
-- Or you can more cleanly use :AddBatch
preloader:AddBatch({
BackgroundMusic = {
SoundId = "rbxassetid://12345678",
Profile = "MusicProfile"
},
JumpSound = {
SoundId = "rbxassetid://87654321",
Profile = "SFXProfile"
}
})
-- Load all sounds and wait for completion... (Yields)
preloader:LoadAndWait()
-- Play preloaded sounds
preloader:PlaySound("BackgroundMusic") -- Plays by ID/Name
Crucial to ensure your sounds are loaded!
API Reference
Functions
View
-
SoundUtils.create(config: SoundConfig | string): Sound- Creates a new Sound instance with the specified configuration or profile name -
SoundUtils.createFromProfile(profileName: string, overrides?: SoundConfig): Sound- Creates a sound using a profile with optional property overrides -
SoundUtils.createAll(configs: {SoundConfig | string}, acceptByTable: boolean): ...Sound | {[string]: Sound}- Creates multiple sounds from an array of configurations or profile names. -
SoundUtils.createAllFromProfile(profileConfigs: {[string]: SoundConfig? | {SoundConfig?}}, acceptByTable: boolean): ...Sound | {[string]: Sound}- Creates multiple sounds from profiles with overrides. -
SoundUtils.play(sound: Sound, debris?: boolean): void- Plays a sound with optional auto-cleanup when finished. -
SoundUtils.playAndWait(sound: Sound, debris?: boolean): void- Plays a sound and yields until it finishes playing. -
SoundUtils.playAsync(sound: Sound, debris?: boolean, callback?: function): RBXScriptConnection- Plays a sound and runs a callback when finished (non-yielding). -
SoundUtils.acquireTimeUntilDone(sound: Sound): number- Gets the time remaining until a playing sound finishes. -
SoundUtils.newProfile(profile: SoundProfile): SoundProfile- Creates a reusable sound profile stored in memory. -
SoundUtils.newPreloader(): SoundPreloader- Creates a new preloader instance for batch sound management. -
SoundUtils.getProfile(profileName: string): SoundProfile?- Retrieves a profile by name. -
SoundUtils.listProfiles(): {string}- Lists all available profile names. -
SoundUtils.removeProfile(profileName: string): void- Removes a profile from memory. -
SoundUtils.profileCount(): number- Gets the number of created profiles. -
SoundUtils.count(): number- Gets the number of created sounds.
Constructors & Methods
View
-
SoundPreloader.new(): SoundPreloader- Constructs a newSoundPreloaderinstance-
:Add(soundId: string, name?: string, profile?: string, overrides?: SoundConfig): SoundPreloader- Adds a single sound to the preloader queue -
:AddBatch(batch: PreloadBatch): SoundPreloader- Adds multiple sounds from a batch configuration -
:LoadAndWait(): void- Loads all queued sounds synchronously and yields until complete -
:LoadAsync(callback?: function): void- Loads all queued sounds asynchronously without yielding -
:GetSound(name: string): Sound?- Gets a preloaded sound by name -
:GetAllSounds(): {[string]: Sound}- Gets all preloaded sounds -
:PlaySound(name: string, debris?: boolean): boolean- Plays a preloader sound by name/id -
:PlaySoundAndWait(name: string, debris?: boolean): boolean- Plays a preloaded sound and yields until it finishes -
:PlaySoundAsync(name: string, debris?: boolean, callback?: function): RBXScriptConnection?- Plays a preloaded sound asynchronously with callback -
:IsLoaded(): boolean- Checks if the preloader has finished loading all sounds -
:GetProgress(): (number, number)- Gets the current loading progress -
:GetProgressPercentage(): number- Gets the loaded progress as a percentage -
:ListSounds(): {string}- Lists all sound names in the preloader -
:Remove(name: string): boolean- Removes a sound from the preloader (only works before loading) -
:Clear(): void- Clears all sounds from the preloader (only works before loading) -
:Destroy(): void- Destroys the preloader and all associated sounds
-
-
SoundProfile.new(profileConfig: SoundProfile): SoundProfile- Constructs a newSoundProfileinstance-
:Sync(updates: SoundProfile): void- Updates the profile with new values, in other words, it syncs the profile withupdates -
:GetProfile(): SoundProfile- Gets the current profile data -
:Destroy(): void- Destroys the profile and cleans up memory
-
Types
View
SoundProfile- Defines properties used in constructing a profileSoundConfig- Defines properties to construct sound InstancesPreloadConfig- Defines how to add sounds to the preloader per batchPreloadBatch- Defines how to add sounds to the preloader using:Batch
Requirements
- Dependencies: InstanceUtils (~ RobloxJrTrainer), TableUtil (~ Sleitnick)
- Usage: Works anywhere! (Client, Server)
- Performance: Light performance overhead
Important Notices
- None that I can think of! SoundUtils is very user-friendly! If you encounter issues or you need help, please let me know and I can help!

Conclusion
SoundUtils is a very powerful and useful utility tool for sound management, with lots of different functions/systems! This module will 100% speed up your precious development time!
Please make sure to like the post if this SoundUtils module is helpful for you! ![]()
Changelog
Version 1.0.0 (Current)
- SoundUtils release with lots of sound management functions and classes
License
Free to use and modify for any Roblox projects. Credits appreciated but not required.
Installation
You can download here on Roblox Creator Store: SoundUtils
Last Updated: 8/3/25
Author: RobloxJrTrainer
Version: 1.0.0