This commit is contained in:
Felix Roos
2024-01-10 21:44:16 +01:00
parent 3cd49065c8
commit 9fd86458e6
4 changed files with 10 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
csaw
+7
View File
@@ -0,0 +1,7 @@
#include <math.h>
#include <emscripten.h>
EMSCRIPTEN_KEEPALIVE
double saw(double t, double f) {
return fmod((f * t * 1.0), 1.0) - 0.5 * 2.0;
}
Binary file not shown.
+2 -1
View File
@@ -5,7 +5,8 @@ document.getElementById('play').addEventListener('click', async () => {
await ac.audioWorklet.addModule('./worklet.js');
const node = new AudioWorkletNode(ac, 'saw-processor');
let res = await fetch('./zigsaw/zigsaw.wasm');
//let res = await fetch('./zigsaw/zigsaw.wasm');
let res = await fetch('./csaw/csaw.wasm');
//let res = await fetch('./rustsaw/pkg/rustsaw_bg.wasm');
const buffer = await res.arrayBuffer();
node.port.onmessage = (e) => {