Learn
Motor Sınıfı
SoundService
Oluşturulamaz
Hizmet

*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.


Kod Örnekleri
Dinamik Reverb Sistemi
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,
}
-- parçaları topla ve etiketlerine göre gruplandır
local parts = {}
for reverbTag, reverbType in pairs(reverbTags) do
for _, part in pairs(CollectionService:GetTagged(reverbTag)) do
parts[part] = reverbType
end
end
-- bir pozisyonun bir parçanın hacmi içinde olup olmadığını kontrol etme işlevi
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
-- varsayılan olarak reverb yok
local newReverbType = Enum.ReverbType.NoReverb
if character and character.PrimaryPart then
local position = character.PrimaryPart.Position
-- tüm indekslenmiş parçaları geç
for part, type in pairs(parts) do
-- karakterin onların içinde olup olmadığını kontrol et
if positionInPart(part, position) then
-- eğer öyleyse, o reverb türünü seç
newReverbType = type
break
end
end
end
-- reverb türü değiştiyse ayarla
if newReverbType ~= reverbType then
SoundService.AmbientReverb = newReverbType
reverbType = newReverbType
end
end

API Referansı
Özellikler
AcousticSimulationEnabled
Paralel oku
Capabilities: Audio
SoundService.AcousticSimulationEnabled:boolean

AmbientReverb
Paralel oku
Capabilities: Audio
SoundService.AmbientReverb:Enum.ReverbType

CharacterSoundsUseNewApi
Eklenti Güvenliği
Paralel oku
Capabilities: Audio
SoundService.CharacterSoundsUseNewApi:Enum.RolloutState

DefaultListenerLocation
Eklenti Güvenliği
Paralel oku
Capabilities: Audio
SoundService.DefaultListenerLocation:Enum.ListenerLocation

DistanceFactor
Paralel oku
Capabilities: Audio
SoundService.DistanceFactor:number

DopplerScale
Paralel oku
Capabilities: Audio
SoundService.DopplerScale:number

ListenerCFrame
Paralel oku
Capabilities: Audio
SoundService.ListenerCFrame:CFrame

ListenerObject
Paralel oku
Capabilities: Audio
SoundService.ListenerObject:Instance

ListenerType
Paralel oku
Capabilities: Audio
SoundService.ListenerType:Enum.ListenerType

RespectFilteringEnabled
Paralel oku
Capabilities: Audio
SoundService.RespectFilteringEnabled:boolean

RolloffScale
Paralel oku
Capabilities: Audio
SoundService.RolloffScale:number

VolumetricAudio
Betiklenemez
Paralel oku
Capabilities: Audio
SoundService.VolumetricAudio:Enum.VolumetricAudio

Yöntemler
GetListener
Capabilities: Audio
SoundService:GetListener():Tuple
Dönüşler

GetMixerTime
Capabilities: Audio
SoundService:GetMixerTime():number
Dönüşler

OpenAttenuationCurveEditor
Eklenti Güvenliği
Capabilities: Audio
SoundService:OpenAttenuationCurveEditor(selectedCurveObjects:Instances):()
Parametreler
selectedCurveObjects:Instances
Dönüşler
()

OpenDirectionalCurveEditor
Eklenti Güvenliği
Capabilities: Audio
SoundService:OpenDirectionalCurveEditor(selectedCurveObjects:Instances):()
Parametreler
selectedCurveObjects:Instances
Dönüşler
()

PlayLocalSound
Capabilities: Audio
SoundService:PlayLocalSound(sound:Instance):()
Parametreler
sound:Instance
Dönüşler
()

SetListener
Capabilities: Audio
SoundService:SetListener(
listenerType:Enum.ListenerType, listener:Tuple
):()
Parametreler
listenerType:Enum.ListenerType
listener:Tuple
Dönüşler
()

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.