We use cookies on this site to enhance your user experience

A Sound is an object that emits sound. Sounds can be uploaded in either .mp3 or .ogg formats. See Articles/Sounds|Sounds for more info on how to upload a sound file.

2D and 3D sound

A sound placed in a BasePart or an Attachment will emit its sound from that part’s BasePart/Position or the attachment’s Attachment/WorldPosition. A sound exhibits the Doppler effect, meaning its frequency and pitch varies with the relative motion of whatever attachment or part it is attached to. The volume of the sound will be determined by the distance between the client’s sound listener (by default the Camera's position) and the position of the Sound’s parent. For more information on this see Sound/RollOffMode.

A sound is considered global if it is not parented to a BasePart or an Attachment. In this case, the sound will play at the same volume throughout the entire place.

Sound replication

Sound playback is not filtered when Experimental Mode is disabled. This means the Sound/TimePosition and Sound/Playing properties will replicate from the client to the server. If a particular client starts playing a sound, all the other clients will play it too. It is important to note that while the playback of sounds will replicate, other properties (such as the playback speed, pitch, volume, etc) will not replicate. This behavior can be avoided by creating all sounds locally on the client, as instancing sounds will not replicate to the server.

Sound/TimePosition, Sound/TimeLength, Sound/Playing will all properly replicate when set from the server.

Properties

Name Type Description
float

The minimum distance at which a 3D Sound (direct child of a BasePart or Attachment) will begin to attenuate (decrease in volume).

bool

This property will be true when the Sound has loaded loaded from Roblox servers and is ready to play.

bool

This read-only property will return true when the Sound is not playing.

bool

This read-only property will return true when the Sound is playing.

bool

This sets whether or not the Sound repeats once it has finished when it is playing.

float

The maximum distance a client’s listener can be from the Sound's origin and still hear it. Only applies to Sounds parented to a Part or Attachment (3D sounds).

bool

When true, the Sound will play when it is removed from the game, by parenting the Sound or one if its ancestors to nil.

double

A number between 0 and 1000 indicating how loud the Sound is currently playing back.

float

Determines the speed at which a Sound will play, with higher values causing the sound to play faster and at a higher pitch.

bool

Indicates whether the Sound is currently playing. This can be toggled, and this property will always replicate, even with Experimental Mode disabled.

RollOffMode

Controls how the volume of a 3D Sound (parented to a BasePart or Attachment) behaves as the distance between the listener and sound’s parent changes.

SoundGroup

The SoundGroup that is linked to this Sound. Volume and SoundEffects applied to this sound group will pass onto the sound. A sound can only be in one sound group at a time.

Content

This property is the content ID of the sound file a Sound object is associated with. Once a sound has been uploaded to Roblox the content ID can be found in the uploaded sound’s URL.

double

The length of the Sound in seconds. If the Sound is not loaded, this value will be 0.

double

Shows the progress in seconds of the Sound. Can be changed to move the playback position of the Sound both before and during playback.

float

The volume of the Sound. Can be set between 0 and 10. Defaults to 0.5

Inherited from Instance

Archivable ClassName DataCost Name Parent RobloxLocked

Functions

Name Type Description
void

Sets Sound/Playing to false. This pauses the playback of the Sound if the sound is playing. As Sound/TimePosition is not reset ,when the Sound is resumed it will continue from its previous position.

void

Plays the Sound. Sets Sound/TimePosition to the last value set by a Script (or 0 if it has not been set), and then sets Sound/Playing to true.

void

Resumes the Sound. Sets Sound/Playing to true. Does not alter Sound/TimePosition and thus can be used to resume the playback of a sound stopped using Sound/Pause.

void

Stops the Sound. Sets Sound/Playing to false then sets Sound/TimePosition to 0.

Inherited from Instance

ClearAllChildren Clone Destroy FindFirstAncestor FindFirstAncestorOfClass FindFirstAncestorWhichIsA FindFirstChild FindFirstChildOfClass FindFirstChildWhichIsA GetChildren GetDebugId GetDescendants GetFullName GetPropertyChangedSignal IsA IsAncestorOf IsDescendantOf WaitForChild

Events

Name Type Description

Event that fires whenever the Sound loops. Returns soundId and numOfTimesLooped, giving the contentID of the sound and the number of times looped respectively.

Fires when the Sound has completed playback and stopped.

Fires when the /Sound is loaded.

Fires whenever the Sound is paused using Sound/Pause.

Fires whenever the Sound is played using the Sound/Play function.

Fires when the Sound is resumed using Sound/Resume.

Fires when the Sound is stopped due to the Sound/Stop function.

Inherited from Instance

AncestryChanged Changed ChildAdded ChildRemoved DescendantAdded DescendantRemoving