AudioCompressor 調整音頻流的動態範圍。任何暫時的高音會根據壓縮器的屬性而被壓扁。
Class.AudioCompressor 提供 輸入 和 側鏈 連接器,可以由 0>Class.Wire.TargetName0> 目標,並且使用 AudioCompressor3> 連接器使用。
範例程式碼
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