Skip to content

AudioPlayAtOptions

Type

AudioPlayAtOptions configures playback speed, distance attenuation, volume, mixer bus routing, and the receiving players for a one-shot Audio.PlayAt cue.

Example

-- Server script in a part.
local CHIME = "144115188075855954"
local pos = self.Position
if pos then
    Audio.PlayAt(CHIME, pos, {
        Volume = 0.8,
        PlaybackSpeed = 1.15,
        RollOffMinDistance = 12,
        RollOffMaxDistance = 300,
        RollOffScale = 1.5,
        Bus = "SFX",
    })
end

Volume

Field
Volume: number?

Volume sets the cue loudness multiplier (0 to 10).

Default 1

PlaybackSpeed

Field
PlaybackSpeed: number?

PlaybackSpeed scales both pitch and playback rate (0.05 to 10).

Default 1

RollOffMinDistance

Field
RollOffMinDistance: number?

RollOffMinDistance sets the distance in units within which the cue plays at full volume (above 0, up to 1000000).

Default 10

RollOffMaxDistance

Field
RollOffMaxDistance: number?

RollOffMaxDistance sets the distance in units (above 0, up to 1000000) past which distance falloff stops and the server skips sending the cue to a player's character. A RollOffMinDistance greater than RollOffMaxDistance raises an error, so set RollOffMinDistance as well when RollOffMaxDistance is below 10.

Default 200

RollOffScale

Field
RollOffScale: number?

RollOffScale scales the distance attenuation rate past RollOffMinDistance (0 to 10).

Default 1

Bus

Field
Bus: SoundBus?

Bus routes the cue to "Master", "Music", "SFX", or "UI".

Default "SFX"

To

Field
To: (Entity | { Entity })?

To sends the cue only to the given player, or to each player in a list. A client script that sets To raises an error.

Default nil