Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public interface AudioProcessor

Custom DSP in Java, the Codename One counterpart of the Web Audio AudioWorkletProcessor. An AudioProcessorNode calls process once per render quantum of 128 frames, on the render thread.

The arrays follow the worklet’s layout: inputs[input][channel][frame], outputs[output][channel][frame] and parameters[param][frame]. An input with nothing connected has one silent channel. A parameter whose value is constant for the quantum is an array of length 1; otherwise it has 128 values. Outputs arrive zeroed.

The method runs on the audio thread: it must not block, wait on the EDT or allocate in steady state, or the output glitches. Keep the arrays only for the duration of the call; they are reused.

Methods

public abstract boolean process(float[][][] inputs, float[][][] outputs, float[][] parameters)Renders one quantum.

Method details

process

public abstract boolean process(float[][][] inputs, float[][][] outputs, float[][] parameters)
Renders one quantum.

Parameters

inputs float[][][]
the mixed input of each input, per channel
outputs float[][][]
the output to fill, per output and channel
parameters float[][]
the value of each declared parameter, in declaration order

Returns

true to keep processing; false to have the node output silence from now on, as a worklet does once its processor stops answering true