Skip to content

Commit

Permalink
soundfile support for offline plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Fr0stbyteR committed Apr 30, 2024
1 parent 200993e commit bfa3889
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,10 @@ $(async () => {
const generator = new FaustMonoDspGenerator();
await generator.compile(faustCompiler, "main", code, args.join(" "));
const soundfileList = generator.getSoundfileList();
const soundfiles = await loadSoundfiles(new OfflineAudioContext({ sampleRate: plotSR, length: 1 }), soundfileList);
const offlineCtx = new OfflineAudioContext({ sampleRate: plotSR, length: 1 });
const soundfiles = await loadSoundfiles(offlineCtx, soundfileList);
generator.addSoundfiles(soundfiles);
const processor = await generator.createOfflineProcessor(plotSR, 128);
const processor = await generator.createOfflineProcessor(plotSR, 128, undefined, offlineCtx);
const output = processor.render([], plot);
uiEnv.analyser.plotHandler(output, 0, undefined, true);
// TODO(ijc): should this happen immediately (before rendering is done?)
Expand Down

0 comments on commit bfa3889

Please sign in to comment.