AudioCompressor 调整音频流的动态范围。任何暂时的高音都会根据压缩器的属性被压缩。
Class.AudioCompressor 提供 输入 和 侧链 端口,可以由0>Class.Wire.TargetName0>和3>Class.Wire.SourceName3>目标,并使用6>Class.Wire.TargetName6>和AudioCompressor9>的AudioCompressor0>端口。
代码示例
Sidechain Compression
local deviceOutput: AudioDeviceOutput = Instance.new("AudioDeviceOutput")
deviceOutput.Parent = workspace
local explosionPlayer: AudioPlayer = Instance.new("AudioPlayer")
explosionPlayer.Parent = workspace
explosionPlayer.AssetId = "rbxassetid://1835333184"
local ambiencePlayer = Instance.new("AudioPlayer")
ambiencePlayer.AssetId = "rbxassetid://9112854440"
local compressor = Instance.new("AudioCompressor")
local wireToCompressor = Instance.new("Wire")
local wireToSidechain = Instance.new("Wire")
local wireToOutput = Instance.new("Wire")
ambiencePlayer.Parent = workspace
compressor.Parent = workspace
wireToCompressor.Parent = workspace
wireToSidechain.Parent = workspace
wireToOutput.Parent = workspace
wireToCompressor.SourceInstance = ambiencePlayer
wireToCompressor.TargetInstance = compressor
wireToSidechain.SourceInstance = explosionPlayer
wireToSidechain.TargetInstance = compressor
wireToSidechain.TargetName = "Sidechain"
wireToOutput.SourceInstance = compressor
wireToOutput.TargetInstance = deviceOutput
ambiencePlayer:Play()
概要
属性
属性
方法
GetConnectedWires
Instances
返回连接到指定端置顶的Wires阵列。AudioCompressor有一个“输入”端置顶、一个“侧链”端置顶和一个“输出”端置顶。
参数
返回
Instances