Reference API Roblox

Engine API

Website

Related

Reference API Roblox

SoundService

A service that determines various aspects of how Sounds play in the experience.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service]

Member index 30

HistoryMember
553AmbientReverb: ReverbType
645DefaultListenerLocation: ListenerLocation
553DistanceFactor: float
553DopplerScale: float
553RespectFilteringEnabled: bool
553RolloffScale: float
553VolumetricAudio: VolumetricAudio
462BeginRecording(): bool
462EndRecording(): Dictionary
645GetAudioInstances(): Array
550GetInputDevice(): Tuple
550GetInputDevices(): Tuple
462GetListener(): Tuple
467GetOutputDevice(): Tuple
467GetOutputDevices(): Tuple
462GetRecordingDevices(): Dictionary
462GetSoundMemoryData(): Dictionary
648OpenAttenuationCurveEditor(selectedCurveObjects: Instances): null
649OpenDirectionalCurveEditor(selectedCurveObjects: Instances): null
573PlayLocalSound(sound: Instance): null
573SetInputDevice(name: string, guid: string): null
573SetListener(listenerType: ListenerType, listener: Tuple): null
573SetOutputDevice(name: string, guid: string): null
462SetRecordingDevice(deviceIndex: int): bool
599AudioInstanceAdded(instance: Instance)
475DeviceListChanged(newDevices: Tuple)
648OpenAttenuationCurveEditorSignal(selectedCurveObjects: Instances)
648OpenAudioEqualizerEditorSignal(selectedEqualizerObjects: Instances)
648OpenDirectionalCurveEditorSignal(selectedCurveObjects: Instances)
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 1

HistoryMember
473PlayStockSound(sound: SoundType): void

Description

A service that determines various aspects of how Sounds play in the experience. SoundService is also often used to store SoundGroups, although this is not mandatory for groups to work.

SoundService properties such as AmbientReverb, DistanceFactor, DopplerScale and RolloffScale can be used to change how all Sounds play in the experience, and the SetListener() function allows you to set the position from where sounds are heard.

History 94

Members 30

AmbientReverb

TypeDefault
ReverbTypeNoReverb

Each ReverbType option for this property corresponds to a preset available in the FMOD sound engine. For example, when AmbientReverb is set to ReverbType.Hangar, sound will reverberate differently to simulate being in a large enclosed space.

Changing AmbientReverb affects the following properties used by Roblox's sound engine.

  • Reverberation decay time.
  • Initial reflection delay time.
  • Late reverberation delay time relative to initial reflection.
  • Reference high frequency.
  • High-frequency to mid-frequency decay time ratio.
  • Value that controls the echo density in the late reverberation decay.
  • Value that controls the modal density in the late reverberation decay.
  • Reference low frequency.
  • Relative room effect level at low frequencies.
  • Relative room effect level at high frequencies.
  • Early reflections level relative to room effect.
  • Room effect level at mid frequencies.

History 7

AudioInstanceAdded

Parameters (1)
instanceInstance

History 1

BeginRecording

Parameters (0)
No parameters.
Returns (1)
bool

History 8

DefaultListenerLocation

TypeDefault
ListenerLocationDefault

History 1

DeviceListChanged

Parameters (1)
newDevicesTuple

History 1

DistanceFactor

TypeDefault
float3.32999992

The number of studs to be considered a meter by SoundService when calculating volume attenuation of Sounds parented to a BasePart or Attachment.

By default, this property is 3.33, meaning that a meter is considered 3.33 studs for the purposes of volume attenuation. The greater the DistanceFactor, the more gradually sound will attenuate.

It's recommended that you only change this property if your experience uses a different scale. For example, when using larger custom characters, you may want to reduce DistanceFactor.

History 7

DopplerScale

TypeDefault
float1

This property determines the degree to which the pitch of a Sound varies due to the Doppler effect, a phenomenon whereby the pitch of a sound changes as the source and observer of the sound move further away or closer together. Only affects Sounds that are parented to a BasePart or Attachment.

Increasing this value exaggerates the impact of the Doppler effect, whereas decreasing it minimizes it. By default, the value of this property is 1.

History 7

EndRecording

Parameters (0)
No parameters.
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 11

Tags: [Yields]

GetAudioInstances

Parameters (0)
No parameters.
Returns (1)
Array

History 1

GetInputDevice

Parameters (0)
No parameters.
Returns (1)
Tuple

History 1

GetInputDevices

Parameters (0)
No parameters.
Returns (1)
Tuple

History 1

GetListener

Parameters (0)
No parameters.
Returns (1)
Tuple

This method returns the SoundService current listener type and what is set as the listener, meaning the point from which audio in the experience is "heard" by the player. By default, the listener is set to Workspace.CurrentCamera. The listener can be changed using SetListener().

The first result returned is the listener's ListenerType and the second result is dependent on that type:

Listener TypeDescription
ListenerType.CameraDoes not return a listener object as CurrentCamera is always used.
ListenerType.CFrameReturns the CFrame used in SetListener().
ListenerType.ObjectPositionReturns the BasePart used in SetListener().
ListenerType.ObjectCFrameReturns the BasePart used in SetListener().

History 2

GetOutputDevice

Parameters (0)
No parameters.
Returns (1)
Tuple

History 1

GetOutputDevices

Parameters (0)
No parameters.
Returns (1)
Tuple

History 1

GetRecordingDevices

Parameters (0)
No parameters.
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetSoundMemoryData

Parameters (0)
No parameters.
Returns (1)
Dictionary

History 2

OpenAttenuationCurveEditor

Parameters (1)
selectedCurveObjectsInstances
Returns (1)
null

History 2

OpenAttenuationCurveEditorSignal

Parameters (1)
selectedCurveObjectsInstances

History 2

OpenAudioEqualizerEditorSignal

Parameters (1)
selectedEqualizerObjectsInstances

History 2

OpenDirectionalCurveEditor

Parameters (1)
selectedCurveObjectsInstances
Returns (1)
null

History 2

OpenDirectionalCurveEditorSignal

Parameters (1)
selectedCurveObjectsInstances

History 1

PlayLocalSound

Parameters (1)
soundInstance
Returns (1)
null

Plays a Sound locally, meaning the sound will only be heard by the client calling this method, regardless of where it's parented to. This method is most useful for playing a Sound locally in the Studio client, for instance in a Script for a Plugin.

History 3

RespectFilteringEnabled

TypeDefault
boolfalse

This property determines whether Sound playback is replicated from the client to the server, and therefore from the server. In other words, when a LocalScript calls Play() and this property is true, the sound will only play on the respective client. If this property is false, other clients will also hear the sound.

Default is true, meaning filtering is enabled.

History 4

RolloffScale

TypeDefault
float1

Sets how fast Sound volume attenuates. The higher the RolloffScale, the more rapidly a sound's volume will attenuate as the distance between the listener and the sound increases.

Note that this property only applies to Sounds whose RollOffMode property is set to Inverse (default) or InverseTapered. Linear and LinearSquare modes use a different attenuation model which is not influenced by this property. This property also has no impact on Sounds which are not parented to a BasePart or Attachment.

History 7

SetInputDevice

Parameters (2)
namestring
guidstring
Returns (1)
null

History 2

SetListener

Parameters (2)
listenerTypeListenerType
listenerTuple
Returns (1)
null

Sets the listener used by the client, meaning the point from which audio in the experience is "heard" by the player. For Sounds parented to a BasePart or Attachment, the listener influences the volume and left/right balance of a playing sound.

By default, the listener is set to Workspace.CurrentCamera, but a range of different types of listeners can be used.

The listener can be retrieved using GetListener().

History 3

SetOutputDevice

Parameters (2)
namestring
guidstring
Returns (1)
null

History 2

SetRecordingDevice

Parameters (1)
deviceIndexint
Returns (1)
bool

History 2

VolumetricAudio

TypeDefault
VolumetricAudioAutomatic
This property is not scriptable. It cannot be accessed by script code.

History 3

Tags: [NotScriptable]

Removed members 1

PlayStockSound

Parameters (1)
soundSoundType
Returns (1)
void

History 3

Settings