Limiter (Hard)
How to trim above the threshold to prevent source clipping
// Configure the graph for rendering
let context = Assembler(rendering: .live).createAudioGraph()
// Configure an audio source (Renderer) from a local audio file
let url = URL(fileURLWithPath: "/path/to/source.mp3")
let source = MediaRenderer(contentsOf: url)
// Configure a limiter and its dynamic parameters
let destination = HardLimiter()
destination.threshold = -0.1
destination.ceiling = 0.1
// Configure node connections
try context.connect(source: source, to: destination)
try context.connect(source: destination, to: context.destination)
source.play(after: 0)Last updated