DynamicRangeCompressor

class DynamicRangeCompressor : AudioProcessor(source)

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

How quickly (in ms) the compressor clamps down when a loud sound starts. Too low (< 1 ms): no transient punch, sounds dull. Too high (> 50 ms): loud transients slip through before gain reduces. 5 ms preserves punch while still catching most action scene peaks.

Link copied to clipboard
Link copied to clipboard
open override val isActive: Boolean
Link copied to clipboard
open override val isEnded: Boolean
Link copied to clipboard

Output gain (in dB) applied after compression. Compression reduces overall loudness so makeup gain brings it back up. +12 dB compensates for the typical reduction at a 8:1 ratio with a -24 dB threshold, and also lifts quiet dialogue to a more audible level. Too high risks clipping on uncompressed peaks below the threshold.

Link copied to clipboard
open override val output: ByteBuffer
Link copied to clipboard

How aggressively to compress sounds that exceed the threshold. A ratio of 8:1 means an 8 dB increase above the threshold becomes only 1 dB in the output. Higher = more "squashed" dynamic range. Below ~2 is barely noticeable; above ~10 sounds very processed/radio-like.

Link copied to clipboard

How quickly (in ms) the compressor lets go after a loud sound ends. Too low (< 50 ms): audible "pumping" — volume visibly breathes up/down. Too high (> 800 ms): gain stays low too long, quieter sounds after an action scene stay suppressed for a noticeable time. 400 ms is slow enough to be transparent on most movie content.

Link copied to clipboard

The level (in dB) above which compression kicks in. Signals quieter than this pass through unchanged; louder signals get compressed. Lower = compresses more content (including quieter sounds like dialogue). -24 dB is a good starting point for movies: it catches action peaks while leaving quiet dialogue mostly untouched before makeup gain.

Functions

Link copied to clipboard
open override fun configure(inputAudioFormat: AudioProcessor.AudioFormat): AudioProcessor.AudioFormat
Link copied to clipboard
open fun flush(streamMetadata: AudioProcessor.StreamMetadata?)
open override fun flush()
Link copied to clipboard
Link copied to clipboard
open override fun getOutput(): ByteBuffer
Link copied to clipboard
open override fun isActive(): Boolean
Link copied to clipboard
open override fun isEnded(): Boolean
Link copied to clipboard
open override fun queueEndOfStream()
Link copied to clipboard
open override fun queueInput(inputBuffer: ByteBuffer)
Link copied to clipboard
open override fun reset()
Link copied to clipboard