Aprender
Clase de motor
SoundService
No creable
Servicio

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.


Muestras de código
Sistema de Reverb Dinámico
local Players = game:GetService("Players")
local CollectionService = game:GetService("CollectionService")
local SoundService = game:GetService("SoundService")
local localPlayer = Players.LocalPlayer
local reverbTags = {
["reverb_Cave"] = Enum.ReverbType.Cave,
}
-- recolectar partes y agruparlas por etiqueta
local parts = {}
for reverbTag, reverbType in pairs(reverbTags) do
for _, part in pairs(CollectionService:GetTagged(reverbTag)) do
parts[part] = reverbType
end
end
-- función para verificar si una posición está dentro de las dimensiones de una parte
local function positionInPart(part, position)
local extents = part.Size / 2
local offset = part.CFrame:PointToObjectSpace(position)
return offset.x < extents.x and offset.y < extents.y and offset.z < extents.z
end
local reverbType = SoundService.AmbientReverb
while true do
task.wait()
if not localPlayer then
return
end
local character = localPlayer.Character
-- por defecto sin reverb
local newReverbType = Enum.ReverbType.NoReverb
if character and character.PrimaryPart then
local position = character.PrimaryPart.Position
-- recorrer todas las partes indexadas
for part, type in pairs(parts) do
-- ver si el personaje está dentro de ellas
if positionInPart(part, position) then
-- si es así, elegir ese tipo de reverb
newReverbType = type
break
end
end
end
-- establecer el tipo de reverb si ha cambiado
if newReverbType ~= reverbType then
SoundService.AmbientReverb = newReverbType
reverbType = newReverbType
end
end

Referencia API
Propiedades
AcousticSimulationEnabled
Leer paralelo
Capacidades: Audio
SoundService.AcousticSimulationEnabled:boolean

AmbientReverb
Leer paralelo
Capacidades: Audio
SoundService.AmbientReverb:Enum.ReverbType

CharacterSoundsUseNewApi
Seguridad del plugin
Leer paralelo
Capacidades: Audio
SoundService.CharacterSoundsUseNewApi:Enum.RolloutState

DefaultListenerLocation
Seguridad del plugin
Leer paralelo
Capacidades: Audio
SoundService.DefaultListenerLocation:Enum.ListenerLocation

DistanceFactor
Leer paralelo
Capacidades: Audio
SoundService.DistanceFactor:number

DopplerScale
Leer paralelo
Capacidades: Audio
SoundService.DopplerScale:number

ListenerCFrame
Leer paralelo
Capacidades: Audio
SoundService.ListenerCFrame:CFrame

ListenerObject
Leer paralelo
Capacidades: Audio
SoundService.ListenerObject:Instance

ListenerType
Leer paralelo
Capacidades: Audio
SoundService.ListenerType:Enum.ListenerType

RespectFilteringEnabled
Leer paralelo
Capacidades: Audio
SoundService.RespectFilteringEnabled:boolean

RolloffScale
Leer paralelo
Capacidades: Audio
SoundService.RolloffScale:number

VolumetricAudio
No programable
Leer paralelo
Capacidades: Audio
SoundService.VolumetricAudio:Enum.VolumetricAudio

Métodos
GetListener
Capacidades: Audio
SoundService:GetListener():Tuple
Devuelve

GetMixerTime
Capacidades: Audio
SoundService:GetMixerTime():number
Devuelve

OpenAttenuationCurveEditor
Seguridad del plugin
Capacidades: Audio
SoundService:OpenAttenuationCurveEditor(selectedCurveObjects:Instances):()
Parámetros
selectedCurveObjects:Instances
Devuelve
()

OpenDirectionalCurveEditor
Seguridad del plugin
Capacidades: Audio
SoundService:OpenDirectionalCurveEditor(selectedCurveObjects:Instances):()
Parámetros
selectedCurveObjects:Instances
Devuelve
()

PlayLocalSound
Capacidades: Audio
SoundService:PlayLocalSound(sound:Instance):()
Parámetros
sound:Instance
Devuelve
()

SetListener
Capacidades: Audio
SoundService:SetListener(
listenerType:Enum.ListenerType, listener:Tuple
):()
Parámetros
listenerType:Enum.ListenerType
listener:Tuple
Devuelve
()

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.