AudioEffectChain

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

Effects in the chain are processed in the order they were added: audio flows through the first effect, then the second, and so on. The chain can be attached to an AudioStream via its effectChain property, and effects can be added or removed at any time (hot-swapped) without stopping the stream.

Create an AudioEffectChain through AudioEngine.createEffectChain.

Example usage:

val engine = AudioEngine.create()
val chain = engine.createEffectChain()

// Create and configure effects
val eq = engine.createEffect(AudioEffectType.PARAMETRIC_EQ)
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)
val reverb = engine.createEffect(AudioEffectType.REVERB)

// Add effects in processing order: EQ -> Compressor -> Reverb
chain.add(eq)
chain.add(compressor)
chain.add(reverb)

// Attach the chain to a stream
stream.effectChain = chain

// Hot-swap: remove an effect while the stream is running
chain.remove(reverb)

// Apply multiple parameter changes atomically
chain.applyBatch(listOf(
ParameterChange(compressor, CompressorParams.THRESHOLD, -12f),
ParameterChange(compressor, CompressorParams.RATIO, 6f),
))

// Release all resources when done
chain.release()

See also

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

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

Effects in the chain are processed in the order they were added: audio flows through the first effect, then the second, and so on. The chain can be attached to an AudioStream via its effectChain property, and effects can be added or removed at any time (hot-swapped) without stopping the stream.

Create an AudioEffectChain through AudioEngine.createEffectChain.

Example usage:

val engine = AudioEngine.create()
val chain = engine.createEffectChain()

// Create and configure effects
val eq = engine.createEffect(AudioEffectType.PARAMETRIC_EQ)
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)
val reverb = engine.createEffect(AudioEffectType.REVERB)

// Add effects in processing order: EQ -> Compressor -> Reverb
chain.add(eq)
chain.add(compressor)
chain.add(reverb)

// Attach the chain to a stream
stream.effectChain = chain

// Hot-swap: remove an effect while the stream is running
chain.remove(reverb)

// Apply multiple parameter changes atomically
chain.applyBatch(listOf(
ParameterChange(compressor, CompressorParams.THRESHOLD, -12f),
ParameterChange(compressor, CompressorParams.RATIO, 6f),
))

// Release all resources when done
chain.release()

See also

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

Effects in the chain are processed in the order they were added: audio flows through the first effect, then the second, and so on. The chain can be attached to an AudioStream via its effectChain property, and effects can be added or removed at any time (hot-swapped) without stopping the stream.

Create an AudioEffectChain through AudioEngine.createEffectChain.

Example usage:

val engine = AudioEngine.create()
val chain = engine.createEffectChain()

// Create and configure effects
val eq = engine.createEffect(AudioEffectType.PARAMETRIC_EQ)
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)
val reverb = engine.createEffect(AudioEffectType.REVERB)

// Add effects in processing order: EQ -> Compressor -> Reverb
chain.add(eq)
chain.add(compressor)
chain.add(reverb)

// Attach the chain to a stream
stream.effectChain = chain

// Hot-swap: remove an effect while the stream is running
chain.remove(reverb)

// Apply multiple parameter changes atomically
chain.applyBatch(listOf(
ParameterChange(compressor, CompressorParams.THRESHOLD, -12f),
ParameterChange(compressor, CompressorParams.RATIO, 6f),
))

// Release all resources when done
chain.release()

See also

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

Effects in the chain are processed in the order they were added: audio flows through the first effect, then the second, and so on. The chain can be attached to an AudioStream via its effectChain property, and effects can be added or removed at any time (hot-swapped) without stopping the stream.

Create an AudioEffectChain through AudioEngine.createEffectChain.

Example usage:

val engine = AudioEngine.create()
val chain = engine.createEffectChain()

// Create and configure effects
val eq = engine.createEffect(AudioEffectType.PARAMETRIC_EQ)
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)
val reverb = engine.createEffect(AudioEffectType.REVERB)

// Add effects in processing order: EQ -> Compressor -> Reverb
chain.add(eq)
chain.add(compressor)
chain.add(reverb)

// Attach the chain to a stream
stream.effectChain = chain

// Hot-swap: remove an effect while the stream is running
chain.remove(reverb)

// Apply multiple parameter changes atomically
chain.applyBatch(listOf(
ParameterChange(compressor, CompressorParams.THRESHOLD, -12f),
ParameterChange(compressor, CompressorParams.RATIO, 6f),
))

// Release all resources when done
chain.release()

See also

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

Effects in the chain are processed in the order they were added: audio flows through the first effect, then the second, and so on. The chain can be attached to an AudioStream via its effectChain property, and effects can be added or removed at any time (hot-swapped) without stopping the stream.

Create an AudioEffectChain through AudioEngine.createEffectChain.

Example usage:

val engine = AudioEngine.create()
val chain = engine.createEffectChain()

// Create and configure effects
val eq = engine.createEffect(AudioEffectType.PARAMETRIC_EQ)
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)
val reverb = engine.createEffect(AudioEffectType.REVERB)

// Add effects in processing order: EQ -> Compressor -> Reverb
chain.add(eq)
chain.add(compressor)
chain.add(reverb)

// Attach the chain to a stream
stream.effectChain = chain

// Hot-swap: remove an effect while the stream is running
chain.remove(reverb)

// Apply multiple parameter changes atomically
chain.applyBatch(listOf(
ParameterChange(compressor, CompressorParams.THRESHOLD, -12f),
ParameterChange(compressor, CompressorParams.RATIO, 6f),
))

// Release all resources when done
chain.release()

See also

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

Effects in the chain are processed in the order they were added: audio flows through the first effect, then the second, and so on. The chain can be attached to an AudioStream via its effectChain property, and effects can be added or removed at any time (hot-swapped) without stopping the stream.

Create an AudioEffectChain through AudioEngine.createEffectChain.

Example usage:

val engine = AudioEngine.create()
val chain = engine.createEffectChain()

// Create and configure effects
val eq = engine.createEffect(AudioEffectType.PARAMETRIC_EQ)
val compressor = engine.createEffect(AudioEffectType.COMPRESSOR)
val reverb = engine.createEffect(AudioEffectType.REVERB)

// Add effects in processing order: EQ -> Compressor -> Reverb
chain.add(eq)
chain.add(compressor)
chain.add(reverb)

// Attach the chain to a stream
stream.effectChain = chain

// Hot-swap: remove an effect while the stream is running
chain.remove(reverb)

// Apply multiple parameter changes atomically
chain.applyBatch(listOf(
ParameterChange(compressor, CompressorParams.THRESHOLD, -12f),
ParameterChange(compressor, CompressorParams.RATIO, 6f),
))

// Release all resources when done
chain.release()

See also

Properties

Link copied to clipboard
actual val effectCount: Int

The number of effects currently in this chain.

actual val effectCount: Int

The number of effects currently in this chain.

expect val effectCount: Int

The number of effects currently in this chain.

actual val effectCount: Int

The number of effects currently in this chain.

actual val effectCount: Int

The number of effects currently in this chain.

actual val effectCount: Int

The number of effects currently in this chain.

Functions

Link copied to clipboard
actual fun add(effect: AudioEffect)

Appends an effect to the end of this chain.

actual fun add(effect: AudioEffect)

Appends an effect to the end of this chain.

expect fun add(effect: AudioEffect)

Appends an effect to the end of this chain.

actual fun add(effect: AudioEffect)

Appends an effect to the end of this chain.

actual fun add(effect: AudioEffect)

Appends an effect to the end of this chain.

actual fun add(effect: AudioEffect)

Appends an effect to the end of this chain.

Link copied to clipboard
actual fun applyBatch(changes: List<ParameterChange>)

Applies multiple parameter changes atomically in a single batch.

actual fun applyBatch(changes: List<ParameterChange>)

Applies multiple parameter changes atomically in a single batch.

expect fun applyBatch(changes: List<ParameterChange>)

Applies multiple parameter changes atomically in a single batch.

actual fun applyBatch(changes: List<ParameterChange>)

Applies multiple parameter changes atomically in a single batch.

actual fun applyBatch(changes: List<ParameterChange>)

Applies multiple parameter changes atomically in a single batch.

actual fun applyBatch(changes: List<ParameterChange>)

Applies multiple parameter changes atomically in a single batch.

Link copied to clipboard
actual fun clear()

Removes all effects from this chain.

actual fun clear()

Removes all effects from this chain.

expect fun clear()

Removes all effects from this chain.

actual fun clear()

Removes all effects from this chain.

actual fun clear()

Removes all effects from this chain.

actual fun clear()

Removes all effects from this chain.

Link copied to clipboard
actual open override fun close()

Closes this chain. Equivalent to release.

actual open override fun close()

Closes this chain. Equivalent to release.

expect open override fun close()

Closes this chain. Equivalent to release.

actual open override fun close()

Closes this chain. Equivalent to release.

actual open override fun close()

Closes this chain. Equivalent to release.

actual open override fun close()

Closes this chain. Equivalent to release.

Link copied to clipboard
actual fun release()

Releases the native resources associated with this chain.

actual fun release()

Releases the native resources associated with this chain.

expect fun release()

Releases the native resources associated with this chain.

actual fun release()

Releases the native resources associated with this chain.

actual fun release()

Releases the native resources associated with this chain.

actual fun release()

Releases the native resources associated with this chain.

Link copied to clipboard
actual fun remove(effect: AudioEffect)

Removes an effect from this chain.

actual fun remove(effect: AudioEffect)

Removes an effect from this chain.

expect fun remove(effect: AudioEffect)

Removes an effect from this chain.

actual fun remove(effect: AudioEffect)

Removes an effect from this chain.

actual fun remove(effect: AudioEffect)

Removes an effect from this chain.

actual fun remove(effect: AudioEffect)

Removes an effect from this chain.