AudioCompressor

非推奨を表示
閲覧できません

AudioCompressor adjusts the dynamic range of audio streams. Any momentary bursts of loudness will be clamped down according to the compressor's properties.

AudioCompressor provides Input and Sidechain pins that can be targeted by Wire.TargetName, and an Output pin that can be used by Wire.SourceName.

コードサンプル

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()

概要

プロパティ

  • 並列読み取り

    Controls how quickly the compressor will clamp down on volume after it surpasses Threshold.

  • 並列読み取り
  • 並列読み取り

    A gain value to be applied after compression.

  • 並列読み取り

    Ratio of input volume to output volume, to be applied when surpassing Threshold.

  • 並列読み取り

    Controls how quickly the compressor will unclamp after the stream volume dips back below Threshold.

  • 並列読み取り

    Gain value at which the compressor will start to modify the input stream.

プロパティ

Attack

並列読み取り

Time, in seconds, denoting how quickly the compressor will clamp down on volume after it surpasses Threshold. Ranges from 0.001 to 0.5.

Bypass

並列読み取り

MakeupGain

並列読み取り

Gain value to be applied after compression, in decibels. After limiting the dynamic range, the resulting stream may be very quiet and this property can be used to compensate. Ranges from -30 to 30.

Ratio

並列読み取り

Ratio of input volume to output volume, to be applied when surpassing Threshold. For example, a value of 2 will cut the amount by which the input stream exceeds the threshold in half whenever the input stream does so. Ranges from 1 to 50.

Release

並列読み取り

Time, in seconds, denoting how quickly the compressor will unclamp after its stream volume dips back below Threshold. Ranges from 0.01 to 0.5.

Threshold

並列読み取り

Gain value at which the compressor will start to modify the input stream, in decibels, with a range of -60 to 0. When the input stream's volume surpasses Threshold, the compressor will take Attack seconds to kick in. When the input stream's volume recedes below Threshold, the compressor will take Release seconds to stop acting.

If any Wires are connected to the Sidechain pin of the compressor, this threshold analyzes those streams instead of the Input streams; this can be used to duck the volume of one stream in response to another.

方法

GetConnectedWires

パラメータ

pin: string

戻り値

イベント