Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
package com.codename1.media.audio
A real-time and offline audio graph modelled on the W3C Web Audio API.
Sources (AudioBufferSourceNode, OscillatorNode, ConstantSourceNode)
feed processing nodes (GainNode, DelayNode, BiquadFilterNode,
IIRFilterNode, StereoPannerNode, ChannelSplitterNode,
ChannelMergerNode) that end at the context’s destination. Node
parameters are AudioParams with sample-accurate automation and can be
modulated by other nodes.
ConvolverNode (reverb), DynamicsCompressorNode, WaveShaperNode
(distortion) and AnalyserNode (spectrum and waveform for visualisers)
complete the processing set.
PannerNode places a source in 3D around the context’s AudioListener,
with the specification’s distance models and sound cones. Its
PanningModel.HRTF mode renders binaurally for headphones from a
structural head model (interaural delay, head shadow and pinna echoes), so
it is the same portable code, with the same result, on every platform.
OfflineAudioContext renders to memory on every platform. AudioContext
plays to the speaker where the platform has a real-time output; call
AudioContext.isSupported() first. Names and behaviour follow the
specification, so Web Audio material applies with Java naming: gain.gain.value = 0.5
becomes gain.getGain().setValue(0.5f).
The graph is rendered by portable code, so a graph sounds the same on every platform it runs on.
Types
class AnalyserNode | Exposes the recent signal and its spectrum for visualisation, passing its input through unchanged: the Web Audio AnalyserNode. |
class AudioBufferSourceNode | Plays AudioData, the Web Audio AudioBufferSourceNode. |
class AudioContext | Renders an audio graph to the device’s speaker in real time, the Web Audio AudioContext. |
enum AudioContextState | The life cycle state of an audio context. |
class AudioData | In-memory PCM audio: one float array per channel, samples nominally in the range -1 to 1. This is the Web Audio AudioBuffer, named differently so it does not clash with the microphone capture class com.codename1.media.AudioBuffer. |
class AudioDestinationNode | The end of every audio graph: the speaker for an AudioContext, the rendered AudioData for an OfflineAudioContext. |
class AudioListener | The position and orientation of the listener every PannerNode of a context is heard from, the Web Audio AudioListener. |
class AudioNode | A processing block of an audio graph, the Web Audio AudioNode. |
interface AudioOutputPeer | A platform audio output stream that pulls samples from an AudioRenderCallback. |
class AudioParam | A value of an AudioNode that can be scheduled ahead of time and modulated by other nodes, the Web Audio AudioParam. |
class AudioParamDescriptor | Declares one AudioParam of an AudioProcessorNode, the Web Audio AudioParamDescriptor. |
interface AudioProcessor | Custom DSP in Java, the Codename One counterpart of the Web Audio AudioWorkletProcessor. |
class AudioProcessorNode | Runs an AudioProcessor in the graph, the Web Audio AudioWorkletNode. |
interface AudioRenderCallback | Supplies the samples an AudioOutputPeer plays. |
class AudioScheduledSourceNode | A source node that is started and stopped at scheduled times, the Web Audio AudioScheduledSourceNode. |
enum AutomationRate | Whether an AudioParam is computed for every sample or once per render quantum. |
class BaseAudioContext | What AudioContext (real time, to the speaker) and OfflineAudioContext (as fast as possible, to memory) share: the clock, the destination and the factory methods for every node, the Web Audio BaseAudioContext. |
class BiquadFilterNode | A second order filter, the Web Audio BiquadFilterNode: low and high pass, band pass, shelves, peaking, notch and all pass. |
enum BiquadFilterType | The response of a BiquadFilterNode. |
enum ChannelCountMode | How an AudioNode decides the number of channels it mixes its inputs to, matching the Web Audio ChannelCountMode enumeration. |
enum ChannelInterpretation | How channels are up-mixed or down-mixed when a connection has a different number of channels than the input it feeds, matching the Web Audio ChannelInterpretation enumeration. |
class ChannelMergerNode | Merges mono inputs into one output with a channel per input, the Web Audio ChannelMergerNode. |
class ChannelSplitterNode | Splits the channels of its input into mono outputs, the Web Audio ChannelSplitterNode. |
class ConstantSourceNode | A mono source whose output is getOffset(), the Web Audio ConstantSourceNode. |
class ConvolverNode | Convolves its input with an impulse response, for reverb and cabinet or room simulation: the Web Audio ConvolverNode. |
class DelayNode | Delays its input by getDelayTime(), the Web Audio DelayNode. |
enum DistanceModelType | How a PannerNode attenuates a source with distance, using its refDistance, maxDistance and rolloffFactor. |
class DynamicsCompressorNode | Lowers the volume of loud passages so the mix stays clear of clipping: the Web Audio DynamicsCompressorNode. |
class GainNode | Multiplies its input by getGain(), the Web Audio GainNode. |
class IIRFilterNode | A general infinite impulse response filter with fixed coefficients, the Web Audio IIRFilterNode. |
class MicrophoneSourceNode | Live captured audio as a graph source, the Codename One counterpart of the Web Audio MediaStreamAudioSourceNode for a microphone. |
class OfflineAudioContext | Renders an audio graph to memory as fast as the device can, the Web Audio OfflineAudioContext. |
class OscillatorNode | A band-limited periodic waveform, the Web Audio OscillatorNode. |
enum OscillatorType | The waveform an OscillatorNode generates. |
enum OverSampleType | How much a WaveShaperNode oversamples while it applies its curve: the Web Audio "none", "2x" and "4x". |
class PannerNode | Positions a source in 3D space relative to the context’s AudioListener, the Web Audio PannerNode. |
enum PanningModel | How a PannerNode places a source in the stereo output. |
class PeriodicWave | A custom oscillator waveform given by its Fourier coefficients, the Web Audio PeriodicWave. |
class StereoPannerNode | Places mono or stereo input in the stereo field with an equal-power law, the Web Audio StereoPannerNode. |
class WaveShaperNode | Applies a transfer curve to every sample, for distortion and saturation: the Web Audio WaveShaperNode. |