Overview of Web Audio API for interactive node editors
The Web Audio API allows for the creation of an audio-processing graph (signal chain) where various audio nodes are connected. Key components include:
- AudioContext: The central controller used to create nodes and manage the audio processing state (suspend/resume).
- Source Nodes: Generate audio (e.g.,
OscillatorNode,MediaElementAudioSourceNode). - Effect Nodes: Modify audio (e.g.,
GainNodefor volume,DelayNode,ConvolverNode). - Output Nodes: The final destination for audio (e.g.,
AudioDestinationNode).
Audio processing occurs on a separate native thread, ensuring that sound generation continues even if the main UI thread is blocked.