summaryrefslogtreecommitdiff
path: root/index.htm
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-11-18 02:33:59 +0100
committerMitya Selivanov <automainint@guattari.tech>2024-11-18 02:33:59 +0100
commit0269c40d9b94f49576b1c7ece0f768eb551686e5 (patch)
treeba87195c3be249e0f43f17bea76e867d567d6901 /index.htm
parent96f9236bff9907fc0508f1920ae98bf3076f4755 (diff)
downloadreduced_system_layer-0269c40d9b94f49576b1c7ece0f768eb551686e5.zip
Update web audio impl
Diffstat (limited to 'index.htm')
-rw-r--r--index.htm15
1 files changed, 15 insertions, 0 deletions
diff --git a/index.htm b/index.htm
index 830ebed..e2e9d55 100644
--- a/index.htm
+++ b/index.htm
@@ -18,6 +18,14 @@
}
process(input, output, parameters) {
// TODO
+
+ let sample_rate = sampleRate;
+ let num_channels = output[0].length;
+ let num_samples = output[0][0].length;
+ let max_num_frames = this.state.max_num_frames;
+
+ let position = this.state.program.instance.exports.js_sound_playback(num_samples);
+
return true;
}
}
@@ -159,7 +167,9 @@
let sound_node;
let sound_state = {
+ program : null,
memory : null,
+ max_num_frames : 0,
buffer_address : 0,
};
@@ -181,6 +191,11 @@
await sound_context.audioWorklet.addModule(URL.createObjectURL(blob));
+ sound_state.program = program;
+ sound_state.memory = memory;
+ sound_state.max_num_frames = program.instance.exports.js_max_num_audio_frames();
+ sound_state.buffer_address = program.instance.exports.js_sound_buffer();
+
sound_node = new AudioWorkletNode(
sound_context,
"Sound_Ring",