Sound¶
An object that emits sound. This object can be placed within a BasePart or Attachment to emit a sound from a particular position within a place or world, or it can be attached elsewhere to play the sound at a constant volume throughout the entire place.
Note: Modern playback properties, 3D rolloff, and the DSP effect set are live. Legacy Pitch/MinDistance/MaxDistance remain as aliases.
Description¶
Sound is an object that emits sound. When placed in a BasePart or an Attachment, this object will emit its sound from that part's BasePart.Position or the attachment's Attachment.WorldPosition. In this placement, 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. Additionally, its volume will be determined by the distance between the client's sound listener (by default the Camera position) and the position of the sound's parent. For more information, see 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.
Inheritance¶
Nova inheritance: Instance → Sound
Properties¶
EmitterSize Alias Property Deprecated The minimum distance, in studs, at which a 3D Sound (direct child of a BasePart or Attachment) will begin to attenuate (decrease in volume).
The minimum distance, in studs, at which a 3D Sound (direct child of a BasePart or Attachment) will begin to attenuate (decrease in volume).
Sounds parented to a BasePart or Attachment that are descendants of the Workspace are considered 3D sounds and their volume while playing is dependent on the distance between the client's sound listener (Camera position by default) and the Sound's parent. Two properties influence this behavior EmitterSize and Sound.RollOffMode.
The way the Sound attenuates (fades out) after the distance between the listener and the sound exceeds the EmitterSize is determined by RollOffMode.
IsLoaded Supported Property This property is true when the Sound has loaded from Roblox servers and is ready to play.
IsPaused Supported Property Read-only property which returns true when the Sound is not playing.
Read-only property which returns true when the Sound is not
playing.
This read-only property returns true when the Sound is not
playing. Note that it can return true if a sound has been paused using
Pause(), if it has been stopped using
Stop(), or the sound has never been played.
As IsPaused is read-only, it cannot be used to stop the sound; Stop() or Pause() should be used instead.
IsPlaying Alias Property Deprecated Read-only property which returns true when the Sound is playing.
Read-only property which returns true when the Sound is playing.
This read-only property returns true when the Sound is playing.
As IsPlaying is read-only, it cannot be used to play the sound; Play() should be used instead.
isPlaying Supported Property Deprecated
No description available.
Looped Supported Property Sets whether or not the Sound repeats once it has finished playing.
LoopRegion Supported Property A range denoting a desired loop start and loop end within the PlaybackRegion, in seconds.
A range denoting a desired loop start and loop end within the PlaybackRegion, in seconds.
-
If LoopRegion.Min
>PlaybackRegion.Min, the loop starts from LoopRegion.Min. -
If LoopRegion.Min
<PlaybackRegion.Min, the loop starts from PlaybackRegion.Min. -
If LoopRegion.Max
>PlaybackRegion.Max, the loop starts at PlaybackRegion.Max. -
If LoopRegion.Max
<PlaybackRegion.Max, the loop starts at exactly that time. -
If LoopRegion.Min
==LoopRegion.Max, the Sound uses the PlaybackRegion property instead.
MaxDistance Alias Property Deprecated The maximum distance, in studs, a client's listener can be from the Class.Sound|Sound\s origin and still hear it. Only applies to Sounds parented to…
The maximum distance, in studs, a client's listener can be from the
Class.Sound|Sound\s origin and still hear it. Only applies to Sounds
parented to a Part or Attachment (3D sounds).
The maximum distance, in studs, a client's listener can be from the Sound origin and still hear it. Only applies to Sounds parented to a Part or Attachment (3D sounds).
How MaxDistance impacts the attenuation of a sound (manner in which it fades out) is dependent on the Sound.RollOffMode property. When RollOffMode is set to use an inverse type distance model (Inverse or InverseTapered) the MaxDistance will not effect the attenuation of the sound. This means that low values for MaxDistance will cause the sound to abruptly cut off when the listener reaches the MaxDistance. In most cases this is not desirable and developers are advised not to use low MaxDistance values.
When RollOffMode is set to a linear type distance model (Linear or LinearSquared) the sound will attenuate between Sound.EmitterSize and MaxDistance (with playback volume reaching zero at MaxDistance). This is less realistic, but in some cases allows attenuation to be handled in a more intuitive way.
MinDistance Alias Property Deprecated The minimum distance at which a 3D Sound (direct child of a BasePart or Attachment) will begin to attenuate. Effectively, the emitter size.
The minimum distance at which a 3D Sound (direct child of a BasePart or Attachment) will begin to attenuate. Effectively, the emitter size.
Pitch Alias Property Deprecated Sets how high pitched and fast a Sound is when it is played. The greater the integer, the higher and faster the Sound is.
Sets how high pitched and fast a Sound is when it is played. The greater the integer, the higher and faster the sound is.
PlaybackRegion Supported Property A range denoting a desired start and stop time within the TimeLength, in seconds.
A range denoting a desired start and stop time within the TimeLength, in seconds.
-
If PlaybackRegion.Min
>0, the sound begins to play from the PlaybackRegion.Min time. -
If PlaybackRegion.Min
<0, the sound begins to play from0. -
If PlaybackRegion.Max
>Sound.TimeLength, the sound stops at Sound.TimeLength. -
If PlaybackRegion.Max
<Sound.TimeLength, the sound stops at exactly that time. -
If PlaybackRegion.Min
==PlaybackRegion.Max, this property is inactive.
PlaybackRegionsEnabled Supported Property If true, this property gives your Sound access to the PlaybackRegion and LoopRegion properties which can more-accurately control its playback.
If true, this property gives your Sound access to the
PlaybackRegion and
LoopRegion properties which can more-accurately
control its playback.
PlaybackSpeed Supported Property Determines the speed at which a Sound will play, with higher values causing the sound to play faster and at a higher pitch.
Determines the speed at which a Sound will play, with higher values causing the sound to play faster and at a higher pitch.
Playing Supported Property Indicates whether the Sound is currently playing.
Indicates whether the Sound is currently playing. This can be toggled, and this property will always replicate.
In Studio's Properties window, while in
Edit mode, toggling Playing to true does not
begin playing the sound, but the sound will begin playing during runtime.
This property should not be confused with IsPlaying which is a read-only property.
Note that when Playing is set to false, the
TimePosition property of the sound will not
reset, meaning that when Playing is set to true
again, the audio will continue from the time position it was at when it
was stopped. However, if the Play() function is used
to resume the sound, the time position will reset to 0.
PlayOnRemove Supported Property When true, the Sound will play when it is removed from the experience.
When true, the Sound will play when it is removed from the
experience by parenting the Sound or one if its ancestors to
nil. This means all of the following will cause the sound to play when
PlayOnRemove is true:
sound:Destroy()sound.Parent = nilsound.Parent.Parent = nil
RollOffMaxDistance Supported Property The maximum distance, in studs, a client's listener can be from the sound's origin and still hear it. Only applies to Sounds parented to a BasePart o…
The maximum distance, in studs, a client's listener can be from the sound's origin and still hear it. Only applies to Sounds parented to a BasePart or Attachment.
How RollOffMaxDistance impacts the attenuation of a sound (manner in which it fades out) is dependent on the RollOffMode property.
RollOffMinDistance Supported Property The minimum distance, in studs, at which a Sound which is parented to a BasePart or Attachment will begin to attenuate (decrease in volume).
The minimum distance, in studs, at which a Sound which is parented to a BasePart or Attachment will begin to attenuate (decrease in volume).
How RollOffMinDistance impacts the attenuation of a sound (manner in which it fades out) is dependent on the RollOffMode property.
RollOffMode Supported Property Controls how the volume of a Sound which is parented to a BasePart or Attachment attenuates (fades out) as the distance between the listener and pare…
This property controls how the volume of a Sound which is parented to a BasePart or Attachment attenuates (fades out) as the distance between the listener and parent changes.
For details on the different modes, see RollOffMode.
SoundGroup Supported Property The SoundGroup that is linked to this Sound.
The SoundGroup that is linked to this Sound.
SoundId Supported Property Content ID of the sound file to associate with the Sound.
This property is the content ID of the sound file to associate with the Sound. See Audio Assets for more information.
TimeLength Supported Property The length of the Sound in seconds.
The length of the Sound in seconds. If the Sound is not
loaded, this value will be 0.
This property is often used in conjunction with PlaybackSpeed to adjust the speed of a sound so that it lasts for a specific duration.
TimePosition Supported Property Progress of the Sound in seconds. Can be changed to move the playback position of the Sound both before and during playback.
Progress of the Sound in seconds. Can be changed to move the playback position of the Sound both before and during playback.
This property reflects the progress of the Sound in seconds. It can be changed to move the playback position of the sound both before and during playback.
As a Sound is played, TimePosition increases at a rate of PlaybackSpeed per second. Once TimePosition reaches TimeLength, the sound will stop unless it is Looped.
Note that setting TimePosition to a value greater than the length in a looped track will not cause it to wrap around. If that behavior is desired, consider the following code snippet:
UsageContextPermission Supported Property
Volume Supported Property The volume of the Sound.
The volume of the Sound. Can be set between 0 and 10 and
defaults to 0.5.
Note that if the Sound is a member of a SoundGroup, its playback volume (but not its Volume property) will be influenced by the group's SoundGroup.Volume property.
Methods¶
Pause Supported Function Pauses playback of the Sound if it is playing.
pause Supported Function Deprecated
No description available.
Play Supported Function Plays the Sound.
Plays the Sound.
This method plays the Sound and sets
TimePosition to the last value set by a script
(or 0 if it has not been set), then sets Playing
to true.
play Supported Function Deprecated Deprecated. Use Play() instead
Deprecated. Use Play() instead
Resume Supported Function Resumes the Sound.
Resumes the Sound.
This method resumes the Sound and sets
Playing to true. Does not alter
TimePosition and thus can be used to resume
playback of a sound paused through Pause().
Stop Supported Function Stops the Sound.
Stops the Sound.
This method stops the Sound and sets Playing
to false, then sets TimePosition to 0.
stop Supported Function Deprecated
No description available.
Events¶
DidLoop Supported Event Fires whenever the Sound loops.
Ended Supported Event Fires when the Sound has completed playback and stopped.
Fires when the Sound has completed playback and stopped. This event is often used to destroy a sound when it has completed playback:
Note that this event will not fire for sounds with
Looped set to true, as they continue playing upon
reaching their end. This event will also not fire when the sound is
stopped before playback has completed; for this use the
Stopped event.
Paused Supported Event Fires whenever the Sound is paused using Pause().
Played Supported Event Fires whenever the Sound is played using Play().
Fires whenever the Sound is played using
Play(). This event will not fire if the
Sound is played due to PlayOnRemove
being set to true and the sound being destroyed.
Stopped Supported Event Fires when the Sound is stopped through using Stop().
Inherited members¶
Inherited from Instance: 8 properties, 36 methods, 7 events. They are documented on the base class page.
5 modern Roblox member(s) are not implemented yet — expand to inspect
Members declared by Roblox's Sound class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.
Properties¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
AcousticSimulationEnabled |
AcousticSimulationEnabled: bool |
Not yet | — | — |
PlaybackLoudness |
PlaybackLoudness: double |
Not yet | A number between 0 and 1000 indicating how loud the Sound is currently playing back. |
ReadOnly, NotReplicated |
Methods¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
GetUnderlyingAudioPlayer |
Sound:GetUnderlyingAudioPlayer(): AudioPlayer |
Not yet | — | RobloxScriptSecurity |
Events¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
Loaded |
Loaded(soundId: string) |
Not yet | Fires when the Sound is loaded. | — |
Resumed |
Resumed(soundId: string) |
Not yet | Fires when the Sound is resumed using Resume(). | — |
Roblox reference: Sound
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.