Skip to main content

SoundGroups

RequiresSchema

Reads and adjusts the SoundGroups the library made from your SOUNDS Configuration.

Every group sits under one main SoundGroup named SOUNDS in SoundService, so the main volume scales all of them.

Functions​

Get​

SoundGroups.Get() → SoundGroups--

Every SoundGroup, keyed by name.

print(VluxySF.Groups.Get())

GetByName​

SoundGroups.GetByName(
name: string--

The group name.

) → SoundGroup?--

The SoundGroup, or nil.

local music = VluxySF.Groups.GetByName("MUSIC")

if music then
	music.Volume = 0.3
end

GetNames​

SoundGroups.GetNames() → {string}--

A new array of every group name.

print(VluxySF.Groups.GetNames())

SetMainVolume​

SoundGroups.SetMainVolume(
mainVolume: number--

The volume.

) → ()

Sets the volume of the main SoundGroup that every other group sits under.

VluxySF.Groups.SetMainVolume(0.3)

SetVolumes​

SoundGroups.SetVolumes(
mainVolume: number?,--

The main volume, or nil to leave it as it is.

volumes: {[string]: number}--

Group volumes, keyed by group name.

) → ()

Sets several volumes at once. A group name that does not exist prints a warning and is skipped.

VluxySF.Groups.SetVolumes(1, {
	MUSIC = 0.7,
	SFX = 0.5,
})

VluxySF.Groups.SetVolumes(nil, { MUSIC = 0.2 }) -- Leaves the main volume alone.
Show raw api
{
    "functions": [
        {
            "name": "Get",
            "desc": "```lua\nprint(VluxySF.Groups.Get())\n```",
            "params": [],
            "returns": [
                {
                    "desc": "Every `SoundGroup`, keyed by name.",
                    "lua_type": "SoundGroups"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 29,
                "path": "lib/Api/Groups.luau"
            }
        },
        {
            "name": "GetByName",
            "desc": "```lua\nlocal music = VluxySF.Groups.GetByName(\"MUSIC\")\n\nif music then\n\tmusic.Volume = 0.3\nend\n```",
            "params": [
                {
                    "name": "name",
                    "desc": "The group name.",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The `SoundGroup`, or `nil`.",
                    "lua_type": "SoundGroup?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 50,
                "path": "lib/Api/Groups.luau"
            }
        },
        {
            "name": "GetNames",
            "desc": "```lua\nprint(VluxySF.Groups.GetNames())\n```",
            "params": [],
            "returns": [
                {
                    "desc": "A new array of every group name.",
                    "lua_type": "{ string }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 65,
                "path": "lib/Api/Groups.luau"
            }
        },
        {
            "name": "SetMainVolume",
            "desc": "Sets the volume of the main `SoundGroup` that every other group sits under.\n\n```lua\nVluxySF.Groups.SetMainVolume(0.3)\n```",
            "params": [
                {
                    "name": "mainVolume",
                    "desc": "The volume.",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 88,
                "path": "lib/Api/Groups.luau"
            }
        },
        {
            "name": "SetVolumes",
            "desc": "Sets several volumes at once. A group name that does not exist prints a warning and is skipped.\n\n```lua\nVluxySF.Groups.SetVolumes(1, {\n\tMUSIC = 0.7,\n\tSFX = 0.5,\n})\n\nVluxySF.Groups.SetVolumes(nil, { MUSIC = 0.2 }) -- Leaves the main volume alone.\n```",
            "params": [
                {
                    "name": "mainVolume",
                    "desc": "The main volume, or `nil` to leave it as it is.",
                    "lua_type": "number?"
                },
                {
                    "name": "volumes",
                    "desc": "Group volumes, keyed by group name.",
                    "lua_type": "{ [string]: number }"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 111,
                "path": "lib/Api/Groups.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SoundGroups",
    "desc": "Reads and adjusts the `SoundGroups` the library made from your `SOUNDS` Configuration.\n\nEvery group sits under one main `SoundGroup` named `SOUNDS` in `SoundService`, so the main volume scales all of\nthem.",
    "tags": [
        "RequiresSchema"
    ],
    "source": {
        "line": 18,
        "path": "lib/Api/Groups.luau"
    }
}