Class AudioProcessorNode

java.lang.Object
com.codename1.media.audio.AudioNode
com.codename1.media.audio.AudioProcessorNode

public final class AudioProcessorNode extends AudioNode

Runs an AudioProcessor in the graph, the Web Audio AudioWorkletNode. Created by BaseAudioContext.createAudioProcessor(AudioProcessor, int, int, int[], AudioParamDescriptor[]). Parameters are real AudioParams, automated and modulated like any other.

A processor that throws is stopped: the node outputs silence from then on and setOnProcessorError(Runnable) runs on the EDT, as the worklet's processorerror event does.

  • Method Details

    • getParameter

      public AudioParam getParameter(String name)

      A declared parameter by name.

      Parameters
      • name: the descriptor's name
      Returns

      the parameter, or null when no descriptor has that name

    • getParameterNames

      public String[] getParameterNames()

      The names of the declared parameters, in declaration order.

      Returns

      a new array of names

    • isFailed

      public boolean isFailed()

      Whether the processor threw and was stopped.

      Returns

      true after a failure

    • setOnProcessorError

      public void setOnProcessorError(Runnable r)

      Sets what runs on the EDT when the processor throws.

      Parameters
      • r: the handler, or null