배우기
엔진 클래스
AudioChannelMixer

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


요약
이벤트
WiringChanged(connected: boolean,pin: string,wire: Wire,instance: Instance):RBXScriptSignal
상속된 멤버
코드 샘플
채널 분리 및 혼합
local Workspace = game:GetService("Workspace")
local function wireUp(source: Instance, target: Instance, sourceName: string?, targetName: string?)
local wire = Instance.new("Wire", source)
wire.SourceInstance = source
wire.TargetInstance = target
if sourceName then
wire.SourceName = sourceName
end
if targetName then
wire.TargetName = targetName
end
return wire
end
local listener = Instance.new("AudioListener")
listener.Parent = Workspace.CurrentCamera
local output = Instance.new("AudioDeviceOutput")
output.Parent = Workspace
local splitter = Instance.new("AudioChannelSplitter")
splitter.Parent = Workspace
local mixer = Instance.new("AudioChannelMixer")
mixer.Parent = Workspace
-- 리스너가 듣는 것을 분리기(splitter)로 보내고 혼합(mix)을 최종 출력(output)으로 전송
wireUp(listener, splitter)
wireUp(mixer, output)
-- 분리기와 혼합기를 4채널 레이아웃으로 설정
splitter.Layout = Enum.AudioChannelLayout.Quad
mixer.Layout = Enum.AudioChannelLayout.Quad
-- 각각의 4개의 채널에 고유의 피치 시프터를 부여
local frontLeft = Instance.new("AudioPitchShifter")
frontLeft.Name = "앞쪽 왼쪽"
frontLeft.Pitch = 1.25
frontLeft.Parent = Workspace
local backLeft = Instance.new("AudioPitchShifter")
backLeft.Name = "뒤쪽 왼쪽"
backLeft.Pitch = 0.5
backLeft.Parent = Workspace
local frontRight = Instance.new("AudioPitchShifter")
frontRight.Name = "앞쪽 오른쪽"
frontRight.Pitch = 1.5
frontRight.Parent = Workspace
local backRight = Instance.new("AudioPitchShifter")
backRight.Name = "뒤쪽 오른쪽"
backRight.Pitch = 0.75
backRight.Parent = Workspace
wireUp(splitter, frontLeft, "왼쪽")
wireUp(splitter, backLeft, "뒤쪽 왼쪽")
wireUp(splitter, frontRight, "오른쪽")
wireUp(splitter, backRight, "뒤쪽 오른쪽")
wireUp(frontLeft, mixer, nil, "왼쪽")
wireUp(backLeft, mixer, nil, "뒤쪽 왼쪽")
wireUp(frontRight, mixer, nil, "오른쪽")
wireUp(backRight, mixer, nil, "뒤쪽 오른쪽")
-- 오디오를 방출(emission)할 부분(part) 구성
local part = Instance.new("Part")
part.Shape = Enum.PartType.Ball
part.Size = Vector3.new(4, 4, 4)
part.Material = Enum.Material.SmoothPlastic
part.CastShadow = false
part.Position = Vector3.new(0, 4, -12)
part.Anchored = true
part.Parent = Workspace
local analyzer = Instance.new("AudioAnalyzer")
analyzer.Parent = part
local emitter = Instance.new("AudioEmitter")
emitter.Parent = part
local assetPlayer = Instance.new("AudioPlayer")
assetPlayer.Looping = true
assetPlayer.Asset = "rbxassetid://97799489309320"
assetPlayer.Parent = emitter
wireUp(assetPlayer, emitter)
wireUp(assetPlayer, analyzer)
-- 오디오 재생 시작
assetPlayer:Play()
-- 오디오가 재생됨에 따라 부분(part)의 색깔 조정
while true do
local peak = math.sqrt(analyzer.PeakLevel)
part.Color = Color3.new(peak, peak, peak)
task.wait()
end

API 참조
속성
Layout
병렬 읽기
기능: Audio
AudioChannelMixer.Layout:Enum.AudioChannelLayout

메서드
GetConnectedWires
기능: Audio
AudioChannelMixer:GetConnectedWires(pin:string):{Wire}
매개 변수
pin:string
반환

GetInputPins
기능: Audio
AudioChannelMixer:GetInputPins():{any}
반환

GetOutputPins
기능: Audio
AudioChannelMixer:GetOutputPins():{any}
반환

이벤트
WiringChanged
기능: Audio
AudioChannelMixer.WiringChanged(
connected:boolean, pin:string, wire:Wire, instance:Instance
매개 변수
connected:boolean
pin:string
wire:Wire
instance:Instance

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