API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classBitCrusherEffect

@codexo/exojs-audio-fx / audio / stable

Lo-fi bit-crusher effect implemented as a WorkletEffect. Applies two classic degradation stages in series: 1. **Bit-depth reduction** - each sample is quantized to `2^bits` discrete levels, adding harmonic distortion characteristic of low-resolution audio. 2. **Sample-rate reduction** - a phase-accumulator sample-and-hold circuit re-latches the (quantized) input only `normFreq` times per input sample on average, producing aliasing artefacts reminiscent of early digital hardware. The worklet emits a pure wet signal; dry/wet mixing is handled by the base class.

6
props
3
methods
0
events
Import
import { BitCrusherEffect } from '@codexo/exojs-audio-fx'

Lo-fi bit-crusher effect implemented as a WorkletEffect. Applies two classic degradation stages in series:

1. **Bit-depth reduction** - each sample is quantized to `2^bits` discrete levels, adding harmonic distortion characteristic of low-resolution audio. 2. **Sample-rate reduction** - a phase-accumulator sample-and-hold circuit re-latches the (quantized) input only `normFreq` times per input sample on average, producing aliasing artefacts reminiscent of early digital hardware.

The worklet emits a pure wet signal; dry/wet mixing is handled by the base class.

Constructors1
new(options: BitCrusherEffectOptions): BitCrusherEffect
Methods3
_onWorkletReady(): void
Subclass hook - called once the worklet is loaded and inserted into the wet path. Use for additional wiring (e.g. a sidechain input).
_setAudioParam(name: string, value: number): void
Ramps an AudioParam on the underlying AudioWorkletNode to value using a short exponential ramp. No-ops if the worklet is not yet loaded. Part of the effect SDK contract for extension audio effects.
destroy(): void
Disconnects all nodes, cancels any pending worklet load, and releases resources.
Properties6
bits: number
Bit depth for sample quantization. Lower values produce more distortion. Range 1..16, default 8.
frequencyReduction: number
Fraction of the sample rate retained (0 = never re-latch, 1 = every sample). Lower values create more aliasing artefacts. Maps to the worklet normFreq AudioParam. Range 0..1, default 0.5.
inputNode: AudioNode
The node where audio enters this effect.
outputNode: AudioNode
The node where audio exits this effect.
ready: Promise<void>
Resolves once the worklet is loaded and inserted into the wet path. Also resolves when the load fails - the effect then stays the clean passthrough it is until the worklet arrives, and the failure is reported through the engine log rather than by rejecting.
wet: number
Wet (processed) mix level, 0..1. The dry level is automatically 1 - wet. Ramped smoothly.
Source