summaryrefslogtreecommitdiff
path: root/index.htm
diff options
context:
space:
mode:
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",