diff options
Diffstat (limited to 'index.htm')
-rw-r--r-- | index.htm | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -194,7 +194,7 @@ let sound_max_num_frames; let sound_shared_ring; - let sound_position = 0; + let sound_position; canvas = attrs.canvas; context = canvas.getContext("2d"); @@ -219,6 +219,7 @@ sound_buffer_address = program.instance.exports.js_sound_buffer(); sound_shared_ring = new SharedArrayBuffer(sound_max_num_frames * 4); + sound_position = 0; sound_node = new AudioWorkletNode( sound_context, @@ -290,7 +291,7 @@ } let dst = new Float32Array(sound_shared_ring); - let src = new Float32Array(memory.subarray(sound_buffer_address, sound_buffer_address + sound_max_num_frames * 4)); + let src = new Float32Array(memory.buffer, sound_buffer_address, sound_max_num_frames); if (num_frames <= sound_max_num_frames - sound_position) for (let i = 0; i < num_frames; ++i) { |