AudioCompressor 오디오 스트림의 동적 범위를 조정합니다. 어떤 순간적인 소음 폭발도 압축기의 속성에 따라 제한됩니다.
는 입력 과 사이드체인 핀을 제공하며, 에 의해 타겟이 될 수 있고 출력 핀은 에 의해 사용될 수 있습니다.
코드 샘플
By using Sidechain compression, the background ambience can be ducked around an explosion
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()
속성
Editor
MakeupGain
압축 후 적용할 값을 데시벨로 얻습니다.동적 범위를 제한한 후에는 결과 스트림이 매우 조용할 수 있으며 이 속성을 사용하여 보상할 수 있습니다.범위 -30에서 30.
Ratio
입력 볼륨/출력 볼륨 비율, Threshold.예를 들어, 2의 값은 입력 스트림이 임계값을 초과할 때마다 입력 스트림의 금액을 절반으로 줄입니다.1에서 50까지의 범위.
메서드
이벤트
WiringChanged
연결되거나 연결 해제된 Wire 후 발생하는 이벤트로, Wire 는 현재 또는 이전에 AudioCompressor 및 다른 연결 가능한 인스턴스에 고정되었거나 고정되었습니다.
매개 변수
인스턴스가 연결되었거나 연결 해제되었는지 여부.
타겟 AudioCompressor 에 있는 핀은 다음과 같습니다.The pin on the that the Wire targets.
Wire 와 다른 인스턴스 사이의 AudioCompressor.