This commit is contained in:
2024-08-31 00:58:39 -06:00
parent 5a48d0bcf7
commit e19333d686
5 changed files with 302 additions and 214 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const SAMPLE_RATE = 48000;
const PACKET_SAMPLES = 480;
const PACKET_SAMPLES = 960;
class RustWorklet extends AudioWorkletProcessor {
constructor(options) {
@@ -20,7 +20,7 @@ class RustWorklet extends AudioWorkletProcessor {
const data = {
format: 'f32',
sampleRate: SAMPLE_RATE,
numberOfFrames: this.buffer_offset,
numberOfFrames: PACKET_SAMPLES,
numberOfChannels: 1,
timestamp: this.timestamp,
data: this.buffer.slice(0, PACKET_SAMPLES),