AudioEffect

actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

An AudioEffect encapsulates a native DSP processor (e.g., gain, compressor, reverb) and exposes a parameter-based API for real-time control. Effects are created through AudioEngine.createEffect and are typically added to an AudioEffectChain before being attached to an AudioStream.

Each effect has a fixed type that determines which parameters are available. Use the corresponding parameter constants object (e.g., CompressorParams, ReverbParams) to discover valid parameter IDs for a given effect type.

On JS, effects are Web Audio nodes rather than the C++ DSP core. The noise gate is a compressor approximation (NoiseGateParams.HOLD_MS is unused). Reverb is a convolver impulse (ReverbParams.WIDTH is unused). BPFParams.BANDWIDTH is converted from octaves to biquad Q.

Example usage:

val engine = AudioEngine.create()
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)

// Configure the compressor
compressor.setParameter(CompressorParams.THRESHOLD, -18f)
compressor.setParameter(CompressorParams.RATIO, 4f)
compressor.setParameter(CompressorParams.ATTACK_MS, 10f)
compressor.setParameter(CompressorParams.RELEASE_MS, 100f)

// Bypass the effect without removing it from the chain
compressor.isEnabled = false

// Re-enable it
compressor.isEnabled = true

// Release native resources when done
compressor.release()

See also

actual class AudioEffect : <ERROR CLASS> ERROR CLASS: Symbol not found for AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

An AudioEffect encapsulates a native DSP processor (e.g., gain, compressor, reverb) and exposes a parameter-based API for real-time control. Effects are created through AudioEngine.createEffect and are typically added to an AudioEffectChain before being attached to an AudioStream.

Each effect has a fixed type that determines which parameters are available. Use the corresponding parameter constants object (e.g., CompressorParams, ReverbParams) to discover valid parameter IDs for a given effect type.

On JS, effects are Web Audio nodes rather than the C++ DSP core. The noise gate is a compressor approximation (NoiseGateParams.HOLD_MS is unused). Reverb is a convolver impulse (ReverbParams.WIDTH is unused). BPFParams.BANDWIDTH is converted from octaves to biquad Q.

Example usage:

val engine = AudioEngine.create()
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)

// Configure the compressor
compressor.setParameter(CompressorParams.THRESHOLD, -18f)
compressor.setParameter(CompressorParams.RATIO, 4f)
compressor.setParameter(CompressorParams.ATTACK_MS, 10f)
compressor.setParameter(CompressorParams.RELEASE_MS, 100f)

// Bypass the effect without removing it from the chain
compressor.isEnabled = false

// Re-enable it
compressor.isEnabled = true

// Release native resources when done
compressor.release()

See also

expect class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

An AudioEffect encapsulates a native DSP processor (e.g., gain, compressor, reverb) and exposes a parameter-based API for real-time control. Effects are created through AudioEngine.createEffect and are typically added to an AudioEffectChain before being attached to an AudioStream.

Each effect has a fixed type that determines which parameters are available. Use the corresponding parameter constants object (e.g., CompressorParams, ReverbParams) to discover valid parameter IDs for a given effect type.

On JS, effects are Web Audio nodes rather than the C++ DSP core. The noise gate is a compressor approximation (NoiseGateParams.HOLD_MS is unused). Reverb is a convolver impulse (ReverbParams.WIDTH is unused). BPFParams.BANDWIDTH is converted from octaves to biquad Q.

Example usage:

val engine = AudioEngine.create()
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)

// Configure the compressor
compressor.setParameter(CompressorParams.THRESHOLD, -18f)
compressor.setParameter(CompressorParams.RATIO, 4f)
compressor.setParameter(CompressorParams.ATTACK_MS, 10f)
compressor.setParameter(CompressorParams.RELEASE_MS, 100f)

// Bypass the effect without removing it from the chain
compressor.isEnabled = false

// Re-enable it
compressor.isEnabled = true

// Release native resources when done
compressor.release()

See also

actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

An AudioEffect encapsulates a native DSP processor (e.g., gain, compressor, reverb) and exposes a parameter-based API for real-time control. Effects are created through AudioEngine.createEffect and are typically added to an AudioEffectChain before being attached to an AudioStream.

Each effect has a fixed type that determines which parameters are available. Use the corresponding parameter constants object (e.g., CompressorParams, ReverbParams) to discover valid parameter IDs for a given effect type.

On JS, effects are Web Audio nodes rather than the C++ DSP core. The noise gate is a compressor approximation (NoiseGateParams.HOLD_MS is unused). Reverb is a convolver impulse (ReverbParams.WIDTH is unused). BPFParams.BANDWIDTH is converted from octaves to biquad Q.

Example usage:

val engine = AudioEngine.create()
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)

// Configure the compressor
compressor.setParameter(CompressorParams.THRESHOLD, -18f)
compressor.setParameter(CompressorParams.RATIO, 4f)
compressor.setParameter(CompressorParams.ATTACK_MS, 10f)
compressor.setParameter(CompressorParams.RELEASE_MS, 100f)

// Bypass the effect without removing it from the chain
compressor.isEnabled = false

// Re-enable it
compressor.isEnabled = true

// Release native resources when done
compressor.release()

See also

actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

An AudioEffect encapsulates a native DSP processor (e.g., gain, compressor, reverb) and exposes a parameter-based API for real-time control. Effects are created through AudioEngine.createEffect and are typically added to an AudioEffectChain before being attached to an AudioStream.

Each effect has a fixed type that determines which parameters are available. Use the corresponding parameter constants object (e.g., CompressorParams, ReverbParams) to discover valid parameter IDs for a given effect type.

On JS, effects are Web Audio nodes rather than the C++ DSP core. The noise gate is a compressor approximation (NoiseGateParams.HOLD_MS is unused). Reverb is a convolver impulse (ReverbParams.WIDTH is unused). BPFParams.BANDWIDTH is converted from octaves to biquad Q.

Example usage:

val engine = AudioEngine.create()
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)

// Configure the compressor
compressor.setParameter(CompressorParams.THRESHOLD, -18f)
compressor.setParameter(CompressorParams.RATIO, 4f)
compressor.setParameter(CompressorParams.ATTACK_MS, 10f)
compressor.setParameter(CompressorParams.RELEASE_MS, 100f)

// Bypass the effect without removing it from the chain
compressor.isEnabled = false

// Re-enable it
compressor.isEnabled = true

// Release native resources when done
compressor.release()

See also

actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

An AudioEffect encapsulates a native DSP processor (e.g., gain, compressor, reverb) and exposes a parameter-based API for real-time control. Effects are created through AudioEngine.createEffect and are typically added to an AudioEffectChain before being attached to an AudioStream.

Each effect has a fixed type that determines which parameters are available. Use the corresponding parameter constants object (e.g., CompressorParams, ReverbParams) to discover valid parameter IDs for a given effect type.

On JS, effects are Web Audio nodes rather than the C++ DSP core. The noise gate is a compressor approximation (NoiseGateParams.HOLD_MS is unused). Reverb is a convolver impulse (ReverbParams.WIDTH is unused). BPFParams.BANDWIDTH is converted from octaves to biquad Q.

Example usage:

val engine = AudioEngine.create()
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)

// Configure the compressor
compressor.setParameter(CompressorParams.THRESHOLD, -18f)
compressor.setParameter(CompressorParams.RATIO, 4f)
compressor.setParameter(CompressorParams.ATTACK_MS, 10f)
compressor.setParameter(CompressorParams.RELEASE_MS, 100f)

// Bypass the effect without removing it from the chain
compressor.isEnabled = false

// Re-enable it
compressor.isEnabled = true

// Release native resources when done
compressor.release()

See also

Properties

Link copied to clipboard
actual var isEnabled: Boolean

Whether this effect is currently active in the processing chain.

actual var isEnabled: Boolean

Whether this effect is currently active in the processing chain.

expect var isEnabled: Boolean

Whether this effect is currently active in the processing chain.

actual var isEnabled: Boolean

Whether this effect is currently active in the processing chain.

actual var isEnabled: Boolean

Whether this effect is currently active in the processing chain.

actual var isEnabled: Boolean

Whether this effect is currently active in the processing chain.

Link copied to clipboard
actual val type: AudioEffectType

The type of this effect, which determines its DSP behavior and available parameters.

actual val type: AudioEffectType

The type of this effect, which determines its DSP behavior and available parameters.

expect val type: AudioEffectType

The type of this effect, which determines its DSP behavior and available parameters.

actual val type: AudioEffectType

The type of this effect, which determines its DSP behavior and available parameters.

actual val type: AudioEffectType

The type of this effect, which determines its DSP behavior and available parameters.

actual val type: AudioEffectType

The type of this effect, which determines its DSP behavior and available parameters.

Functions

Link copied to clipboard
actual open override fun close()

Closes this effect. Equivalent to release.

actual open override fun close()

Closes this effect. Equivalent to release.

expect open override fun close()

Closes this effect. Equivalent to release.

actual open override fun close()

Closes this effect. Equivalent to release.

actual open override fun close()

Closes this effect. Equivalent to release.

actual open override fun close()

Closes this effect. Equivalent to release.

Link copied to clipboard
actual fun getParameter(paramId: Int): Float

Retrieves the current value of a parameter on this effect.

actual fun getParameter(paramId: Int): Float

Retrieves the current value of a parameter on this effect.

expect fun getParameter(paramId: Int): Float

Retrieves the current value of a parameter on this effect.

actual fun getParameter(paramId: Int): Float

Retrieves the current value of a parameter on this effect.

actual fun getParameter(paramId: Int): Float

Retrieves the current value of a parameter on this effect.

actual fun getParameter(paramId: Int): Float

Retrieves the current value of a parameter on this effect.

Link copied to clipboard
actual fun release()

Releases the native resources associated with this effect.

actual fun release()

Releases the native resources associated with this effect.

expect fun release()

Releases the native resources associated with this effect.

actual fun release()

Releases the native resources associated with this effect.

actual fun release()

Releases the native resources associated with this effect.

actual fun release()

Releases the native resources associated with this effect.

Link copied to clipboard
actual fun setParameter(paramId: Int, value: Float)

Sets a parameter on this effect.

actual fun setParameter(paramId: Int, value: Float)

Sets a parameter on this effect.

expect fun setParameter(paramId: Int, value: Float)

Sets a parameter on this effect.

actual fun setParameter(paramId: Int, value: Float)

Sets a parameter on this effect.

actual fun setParameter(paramId: Int, value: Float)

Sets a parameter on this effect.

actual fun setParameter(paramId: Int, value: Float)

Sets a parameter on this effect.