diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-11-18 02:33:59 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-11-18 02:33:59 +0100 |
commit | 0269c40d9b94f49576b1c7ece0f768eb551686e5 (patch) | |
tree | ba87195c3be249e0f43f17bea76e867d567d6901 /index.htm | |
parent | 96f9236bff9907fc0508f1920ae98bf3076f4755 (diff) | |
download | reduced_system_layer-0269c40d9b94f49576b1c7ece0f768eb551686e5.zip |
Update web audio impl
Diffstat (limited to 'index.htm')
-rw-r--r-- | index.htm | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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", |