Chapter 9 of 9
Browser preview
One HTML file can target the plugin and Chrome: factor graph building into a function that receives wax, then always await WaxNative.create(). Browser preview does not send audio to your DAW — same API, local Web Audio only.
Shared builder
function buildOut(w) {
const tone = w.mul(w.cycle(440), 0.15);
return { outL: tone, outR: tone };
}
async function renderGraph() {
if (!wax) wax = await WaxNative.create();
const { outL, outR } = buildOut(wax);
await Promise.resolve(wax.render(outL, outR));
ensureEmit();
}
create() behavior
- WAX: synchronous native instance when the bridge is present.
- Browser: Promise — loads
wax-web-audio.js, samewax.*node names.
FX + meters in the browser
await wax.connectMic()on gesture forwax.in.await wax.resumeAudio()if AudioContext is suspended.- Scope: same hooks as native; optional
attachOutputAnalyser()+pollOutputScope()if graph scope is quiet.
Try it
Full page: Hybrid tone demo
Example code
Snippets from this lesson — combine in your Custom Page.
Loading…