Speaker hello world

Play the smallest useful realtime graph through the system output.

ready

node examples/speaker.js
-d, --duration <time>
run time (CLI accepts s/m/h suffixes; default: 2s)
Graph
Oscillator → Gain → Destination
Input
Duration
Output
System speakers

This is the minimal hello-world example for the Web Audio API in Node: an oscillator into a gain into the destination, playing through the system speakers with no browser involved. It is the smallest AudioContext example in this collection, and the same few lines also run unmodified in the browser.