Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.24k stars 963 forks source link

Cannot export audio via Reberb node using OfflineContext #1241

Closed Johnrobmiller closed 2 months ago

Johnrobmiller commented 2 months ago

Currently, it is impossible to export audio using with the Reverb node using OfflineContext

tambien commented 2 months ago

Make sure you await reverb.ready

This works fine for me:

const buffer = await Offline(async () => {
    const osc = new Oscillator();
    osc.start(0).stop(0.1);
    const reverb = new Reverb(0.2).toDestination();
    osc.connect(reverb);
    // reverb generation is async
    await reverb.ready;
}, 0.3);