Skip to content

Commit

Permalink
fix audio export on local edition
Browse files Browse the repository at this point in the history
  • Loading branch information
spessasus committed Nov 23, 2024
1 parent 70b6d62 commit 6a7c4b6
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion src/spessasynth_lib/synthetizer/worklet_processor.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/website/js/manager/export_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { closeNotification, showNotification } from "../notification/notificatio
import { Synthetizer } from "../../../spessasynth_lib/synthetizer/synthetizer.js";
import { formatTime } from "../../../spessasynth_lib/utils/other.js";
import { audioBufferToWav } from "../../../spessasynth_lib/utils/buffer_to_wav.js";
import { WORKLET_URL_ABSOLUTE } from "../../../spessasynth_lib/synthetizer/worklet_url.js";
import { ANIMATION_REFLOW_TIME } from "../utils/animation_utils.js";
import { MIDIticksToSeconds } from "../../../spessasynth_lib/midi_parser/basic_midi.js";

Expand Down Expand Up @@ -53,7 +52,7 @@ export async function _doExportAudioData(normalizeAudio = true, additionalTime =
sampleRate: sampleRate,
length: sampleDuration
});
await offline.audioWorklet.addModule(new URL("../../spessasynth_lib/" + WORKLET_URL_ABSOLUTE, import.meta.url));
await offline.audioWorklet.addModule(new URL(this.workletPath, import.meta.url));

/**
* take snapshot of the real synth
Expand Down
5 changes: 3 additions & 2 deletions src/website/js/manager/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ class Manager
{
console.warn("DEBUG ENABLED! DEBUGGING ENABLED!!");
}

const prePath = window.isLocalEdition ? "../../../spessasynth_lib/" : "../../spessasynth_lib/";
this.workletPath = prePath + WORKLET_PATH;
if (context.audioWorklet)
{
await context.audioWorklet.addModule(new URL(prePath + WORKLET_PATH, import.meta.url));
await context.audioWorklet.addModule(new URL(this.workletPath, import.meta.url));
}

// set up buffer here (if we let spessasynth use the default buffer, there's no reverb for the first second.)
Expand Down
68 changes: 34 additions & 34 deletions src/website/minified/demo_main.min.js

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions src/website/minified/local_main.min.js

Large diffs are not rendered by default.

0 comments on commit 6a7c4b6

Please sign in to comment.