SoundService
A service that determines various aspects of how Sounds play in the experience.
Memory category | Instances |
---|
Member index 30
Removed member index 1
History | Member | |
---|---|---|
473 | PlayStockSound(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
- 649 Change Security of OpenDirectionalCurveEditor from RobloxScriptSecurity to PluginSecurity
- 648 Add OpenDirectionalCurveEditorSignal
- 648 Change Parameters of OpenAudioEqualizerEditorSignal from (selectedEqualizerObjects: Objects) to (selectedEqualizerObjects: Instances)
- 648 Change Parameters of OpenAttenuationCurveEditorSignal from (selectedCurveObjects: Objects) to (selectedCurveObjects: Instances)
- 648 Add OpenDirectionalCurveEditor
- 648 Change Parameters of OpenAttenuationCurveEditor from (selectedCurveObjects: Objects) to (selectedCurveObjects: Instances)
- 645 Add GetAudioInstances
- 645 Add DefaultListenerLocation
- 630 Add OpenAudioEqualizerEditorSignal
- 629 Add OpenAttenuationCurveEditorSignal
- 629 Add OpenAttenuationCurveEditor
- 599 Add AudioInstanceAdded
- 573 Change ReturnType of SetOutputDevice from void to null
- 573 Change ReturnType of SetListener from void to null
- 573 Change ReturnType of SetInputDevice from void to null
- 573 Change ReturnType of PlayLocalSound from void to null
- 559 Add
- 553 Change Default of VolumetricAudio from to Automatic
- 553 Change Default of RolloffScale from to 1
- 553 Change Default of RespectFilteringEnabled from to false
- 553 Change Default of DopplerScale from to 1
- 553 Change Default of DistanceFactor from to 3.32999992
- 553 Change Default of AmbientReverb from to NoReverb
- 550 Add SetInputDevice
- 550 Add GetInputDevices
- 550 Add GetInputDevice
- 538 Change Tags of VolumetricAudio from [NotScriptable, NotBrowsable] to [NotScriptable]
- 536 Add VolumetricAudio
- 486 Change ThreadSafety of RolloffScale from ReadOnly to ReadSafe
- 486 Change ThreadSafety of RespectFilteringEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of DopplerScale from ReadOnly to ReadSafe
- 486 Change ThreadSafety of DistanceFactor from ReadOnly to ReadSafe
- 486 Change ThreadSafety of AmbientReverb from ReadOnly to ReadSafe
- 475 Add DeviceListChanged
- 473 Remove PlayStockSound
- 467 Add SetOutputDevice
- 467 Add GetOutputDevices
- 467 Add GetOutputDevice
- 462 Change ThreadSafety of SetRecordingDevice from to Unsafe
- 462 Change ThreadSafety of SetListener from to Unsafe
- 462 Change ThreadSafety of PlayStockSound from to Unsafe
- 462 Change ThreadSafety of PlayLocalSound from to Unsafe
- 462 Change ThreadSafety of GetSoundMemoryData from to Unsafe
- 462 Change ThreadSafety of GetRecordingDevices from to Unsafe
- 462 Change ThreadSafety of GetListener from to Unsafe
- 462 Change ThreadSafety of EndRecording from to Unsafe
- 462 Change ThreadSafety of BeginRecording from to Unsafe
- 462 Change ThreadSafety of RolloffScale from to ReadOnly
- 462 Change ThreadSafety of RespectFilteringEnabled from to ReadOnly
- 462 Change ThreadSafety of DopplerScale from to ReadOnly
- 462 Change ThreadSafety of DistanceFactor from to ReadOnly
- 462 Change ThreadSafety of AmbientReverb from to ReadOnly
- 372 Add GetSoundMemoryData
- 305 Add RespectFilteringEnabled
- 259 Add PlayLocalSound
- 252 Add SetRecordingDevice
- 252 Add GetRecordingDevices
- 251 Change Tags of EndRecording from [] to [Yields]
- 251 Change Security of EndRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of EndRecording from string to Dictionary
- 251 Change Security of BeginRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of BeginRecording from void to bool
- 250 Change ReturnType of EndRecording from Dictionary to string
- 250 Change Security of EndRecording from RobloxScriptSecurity to RobloxSecurity
- 250 Change Tags of EndRecording from [Yields] to []
- 250 Change Security of BeginRecording from RobloxScriptSecurity to RobloxSecurity
- 250 Change ReturnType of BeginRecording from bool to void
- 251 Change Tags of EndRecording from [] to [Yields]
- 251 Change Security of EndRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of EndRecording from string to Dictionary
- 251 Change Security of BeginRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of BeginRecording from void to bool
- 249 Add EndRecording
- 249 Add BeginRecording
- 210 Add SetListener
- 210 Add GetListener
- 79 Change Tags of RolloffScale from [preliminary] to []
- 79 Change Tags of DopplerScale from [preliminary] to []
- 79 Change Tags of DistanceFactor from [preliminary] to []
- 79 Change Tags of AmbientReverb from [preliminary] to []
- 78 Change Tags of RolloffScale from [] to [preliminary]
- 78 Change Tags of DopplerScale from [] to [preliminary]
- 78 Change Tags of DistanceFactor from [] to [preliminary]
- 78 Change Tags of AmbientReverb from [] to [preliminary]
- 79 Change Tags of RolloffScale from [preliminary] to []
- 79 Change Tags of DopplerScale from [preliminary] to []
- 79 Change Tags of DistanceFactor from [preliminary] to []
- 79 Change Tags of AmbientReverb from [preliminary] to []
- 47 Add PlayStockSound
- 47 Add RolloffScale
- 47 Add DopplerScale
- 47 Add DistanceFactor
- 47 Add AmbientReverb
- 47 Add SoundService
Members 30
AmbientReverb
Type | Default | |
---|---|---|
ReverbType | NoReverb |
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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 7
- 553 Change Default of AmbientReverb from to NoReverb
- 486 Change ThreadSafety of AmbientReverb from ReadOnly to ReadSafe
- 462 Change ThreadSafety of AmbientReverb from to ReadOnly
- 79 Change Tags of AmbientReverb from [preliminary] to []
- 78 Change Tags of AmbientReverb from [] to [preliminary]
- 79 Change Tags of AmbientReverb from [preliminary] to []
- 47 Add AmbientReverb
AudioInstanceAdded
Parameters (1) | |
---|---|
instance | Instance |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
BeginRecording
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 8
- 462 Change ThreadSafety of BeginRecording from to Unsafe
- 251 Change Security of BeginRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of BeginRecording from void to bool
- 250 Change Security of BeginRecording from RobloxScriptSecurity to RobloxSecurity
- 250 Change ReturnType of BeginRecording from bool to void
- 251 Change Security of BeginRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of BeginRecording from void to bool
- 249 Add BeginRecording
DefaultListenerLocation
Type | Default | |
---|---|---|
ListenerLocation | Default |
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Data |
Loaded/Saved | true |
History 1
DeviceListChanged
Parameters (1) | |
---|---|
newDevices | Tuple |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 475 Add DeviceListChanged
DistanceFactor
Type | Default | |
---|---|---|
float | 3.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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 7
- 553 Change Default of DistanceFactor from to 3.32999992
- 486 Change ThreadSafety of DistanceFactor from ReadOnly to ReadSafe
- 462 Change ThreadSafety of DistanceFactor from to ReadOnly
- 79 Change Tags of DistanceFactor from [preliminary] to []
- 78 Change Tags of DistanceFactor from [] to [preliminary]
- 79 Change Tags of DistanceFactor from [preliminary] to []
- 47 Add DistanceFactor
DopplerScale
Type | Default | |
---|---|---|
float | 1 |
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
.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 7
- 553 Change Default of DopplerScale from to 1
- 486 Change ThreadSafety of DopplerScale from ReadOnly to ReadSafe
- 462 Change ThreadSafety of DopplerScale from to ReadOnly
- 79 Change Tags of DopplerScale from [preliminary] to []
- 78 Change Tags of DopplerScale from [] to [preliminary]
- 79 Change Tags of DopplerScale from [preliminary] to []
- 47 Add DopplerScale
EndRecording
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 11
- 462 Change ThreadSafety of EndRecording from to Unsafe
- 251 Change Tags of EndRecording from [] to [Yields]
- 251 Change Security of EndRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of EndRecording from string to Dictionary
- 250 Change ReturnType of EndRecording from Dictionary to string
- 250 Change Security of EndRecording from RobloxScriptSecurity to RobloxSecurity
- 250 Change Tags of EndRecording from [Yields] to []
- 251 Change Tags of EndRecording from [] to [Yields]
- 251 Change Security of EndRecording from RobloxSecurity to RobloxScriptSecurity
- 251 Change ReturnType of EndRecording from string to Dictionary
- 249 Add EndRecording
GetAudioInstances
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 645 Add GetAudioInstances
GetInputDevice
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Tuple |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 550 Add GetInputDevice
GetInputDevices
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Tuple |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 550 Add GetInputDevices
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 Type | Description |
---|---|
ListenerType.Camera | Does not return a listener object as CurrentCamera is always used. |
ListenerType.CFrame | Returns the CFrame used in SetListener(). |
ListenerType.ObjectPosition | Returns the BasePart used in SetListener(). |
ListenerType.ObjectCFrame | Returns the BasePart used in SetListener(). |
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetListener from to Unsafe
- 210 Add GetListener
GetOutputDevice
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Tuple |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 467 Add GetOutputDevice
GetOutputDevices
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Tuple |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 467 Add GetOutputDevices
GetRecordingDevices
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetRecordingDevices from to Unsafe
- 252 Add GetRecordingDevices
GetSoundMemoryData
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetSoundMemoryData from to Unsafe
- 372 Add GetSoundMemoryData
OpenAttenuationCurveEditor
Parameters (1) | ||
---|---|---|
selectedCurveObjects | Instances | |
Returns (1) | ||
null |
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 648 Change Parameters of OpenAttenuationCurveEditor from (selectedCurveObjects: Objects) to (selectedCurveObjects: Instances)
- 629 Add OpenAttenuationCurveEditor
OpenAttenuationCurveEditorSignal
Parameters (1) | |
---|---|
selectedCurveObjects | Instances |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 648 Change Parameters of OpenAttenuationCurveEditorSignal from (selectedCurveObjects: Objects) to (selectedCurveObjects: Instances)
- 629 Add OpenAttenuationCurveEditorSignal
OpenAudioEqualizerEditorSignal
Parameters (1) | |
---|---|
selectedEqualizerObjects | Instances |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 648 Change Parameters of OpenAudioEqualizerEditorSignal from (selectedEqualizerObjects: Objects) to (selectedEqualizerObjects: Instances)
- 630 Add OpenAudioEqualizerEditorSignal
OpenDirectionalCurveEditor
Parameters (1) | ||
---|---|---|
selectedCurveObjects | Instances | |
Returns (1) | ||
null |
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 649 Change Security of OpenDirectionalCurveEditor from RobloxScriptSecurity to PluginSecurity
- 648 Add OpenDirectionalCurveEditor
OpenDirectionalCurveEditorSignal
Parameters (1) | |
---|---|
selectedCurveObjects | Instances |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
PlayLocalSound
Parameters (1) | ||
---|---|---|
sound | Instance | |
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.
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of PlayLocalSound from void to null
- 462 Change ThreadSafety of PlayLocalSound from to Unsafe
- 259 Add PlayLocalSound
RespectFilteringEnabled
Type | Default | |
---|---|---|
bool | false |
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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of RespectFilteringEnabled from to false
- 486 Change ThreadSafety of RespectFilteringEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of RespectFilteringEnabled from to ReadOnly
- 305 Add RespectFilteringEnabled
RolloffScale
Type | Default | |
---|---|---|
float | 1 |
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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 7
- 553 Change Default of RolloffScale from to 1
- 486 Change ThreadSafety of RolloffScale from ReadOnly to ReadSafe
- 462 Change ThreadSafety of RolloffScale from to ReadOnly
- 79 Change Tags of RolloffScale from [preliminary] to []
- 78 Change Tags of RolloffScale from [] to [preliminary]
- 79 Change Tags of RolloffScale from [preliminary] to []
- 47 Add RolloffScale
SetInputDevice
Parameters (2) | ||
---|---|---|
name | string | |
guid | string | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 573 Change ReturnType of SetInputDevice from void to null
- 550 Add SetInputDevice
SetListener
Parameters (2) | ||
---|---|---|
listenerType | ListenerType | |
listener | Tuple | |
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().
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of SetListener from void to null
- 462 Change ThreadSafety of SetListener from to Unsafe
- 210 Add SetListener
SetOutputDevice
Parameters (2) | ||
---|---|---|
name | string | |
guid | string | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 573 Change ReturnType of SetOutputDevice from void to null
- 467 Add SetOutputDevice
SetRecordingDevice
Parameters (1) | ||
---|---|---|
deviceIndex | int | |
Returns (1) | ||
bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of SetRecordingDevice from to Unsafe
- 252 Add SetRecordingDevice
VolumetricAudio
Type | Default | |
---|---|---|
VolumetricAudio | Automatic |
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 3
- 553 Change Default of VolumetricAudio from to Automatic
- 538 Change Tags of VolumetricAudio from [NotScriptable, NotBrowsable] to [NotScriptable]
- 536 Add VolumetricAudio
Removed members 1
PlayStockSound
Parameters (1) | ||
---|---|---|
sound | SoundType | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 473 Remove PlayStockSound
- 462 Change ThreadSafety of PlayStockSound from to Unsafe
- 47 Add PlayStockSound