배우기
엔진 클래스
SoundService
만들 수 없음
서비스

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


코드 샘플
다이나믹 리버브 시스템
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,
}
-- 태그별로 부품을 수집하고 그룹화합니다.
local parts = {}
for reverbTag, reverbType in pairs(reverbTags) do
for _, part in pairs(CollectionService:GetTagged(reverbTag)) do
parts[part] = reverbType
end
end
-- 위치가 부품의 범위 내에 있는지 확인하는 함수
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
-- 기본적으로 리버브 없음
local newReverbType = Enum.ReverbType.NoReverb
if character and character.PrimaryPart then
local position = character.PrimaryPart.Position
-- 색인된 모든 부품을 확인합니다.
for part, type in pairs(parts) do
-- 캐릭터가 그 안에 있는지 확인합니다.
if positionInPart(part, position) then
-- 그렇다면 해당 리버브 유형을 선택합니다.
newReverbType = type
break
end
end
end
-- 변경된 경우 리버브 유형을 설정합니다.
if newReverbType ~= reverbType then
SoundService.AmbientReverb = newReverbType
reverbType = newReverbType
end
end

API 참조
속성
AcousticSimulationEnabled
병렬 읽기
기능: Audio
SoundService.AcousticSimulationEnabled:boolean

AmbientReverb
병렬 읽기
기능: Audio
SoundService.AmbientReverb:Enum.ReverbType

CharacterSoundsUseNewApi
플러그인 보안
병렬 읽기
기능: Audio
SoundService.CharacterSoundsUseNewApi:Enum.RolloutState

DefaultListenerLocation
플러그인 보안
병렬 읽기
기능: Audio
SoundService.DefaultListenerLocation:Enum.ListenerLocation

DistanceFactor
병렬 읽기
기능: Audio
SoundService.DistanceFactor:number

DopplerScale
병렬 읽기
기능: Audio
SoundService.DopplerScale:number

ListenerCFrame
병렬 읽기
기능: Audio
SoundService.ListenerCFrame:CFrame

ListenerObject
병렬 읽기
기능: Audio
SoundService.ListenerObject:Instance

ListenerType
병렬 읽기
기능: Audio
SoundService.ListenerType:Enum.ListenerType

RespectFilteringEnabled
병렬 읽기
기능: Audio
SoundService.RespectFilteringEnabled:boolean

RolloffScale
병렬 읽기
기능: Audio
SoundService.RolloffScale:number

VolumetricAudio
스크립팅할 수 없음
병렬 읽기
기능: Audio
SoundService.VolumetricAudio:Enum.VolumetricAudio

메서드
GetListener
기능: Audio
SoundService:GetListener():Tuple
반환

GetMixerTime
기능: Audio
SoundService:GetMixerTime():number
반환

OpenAttenuationCurveEditor
플러그인 보안
기능: Audio
SoundService:OpenAttenuationCurveEditor(selectedCurveObjects:Instances):()
매개 변수
selectedCurveObjects:Instances
반환
()

OpenDirectionalCurveEditor
플러그인 보안
기능: Audio
SoundService:OpenDirectionalCurveEditor(selectedCurveObjects:Instances):()
매개 변수
selectedCurveObjects:Instances
반환
()

PlayLocalSound
기능: Audio
SoundService:PlayLocalSound(sound:Instance):()
매개 변수
sound:Instance
반환
()

SetListener
기능: Audio
SoundService:SetListener(
listenerType:Enum.ListenerType, listener:Tuple
):()
매개 변수
listenerType:Enum.ListenerType
listener:Tuple
반환
()

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.