Web Audio Method Chaining Sample
Available in Chrome 48+ |
View on GitHub |
Browse Samples
Background
Web Audio JavaScript syntax can be shortened and simplified with method chaining for the
AudioNode.connect()
and
AudioParam.connect()
automation methods.
This sample does the following:
- Creates an
AudioContext
.
- Creates an audio source node.
- Creates a gain node.
- Creates a filter node.
- Connects nodes from the audio source to the
AudioContext
destination.
- Plays sound!
Live Output
Audio playback:
JavaScript Snippet