We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f05388 commit b2219a2Copy full SHA for b2219a2
audioWorklet.js
@@ -38,17 +38,21 @@ class AudioDataWorkletStream extends AudioWorkletProcessor {
38
});
39
}
40
process(inputs, outputs) {
41
+ if (this.offset === this.uint8.length) {
42
+ this.endOfStream();
43
+ return false;
44
+ }
45
const channels = outputs.flat();
46
const uint8 = new Uint8Array(512);
47
for (let i = 0; i < 512; i++, this.offset++) {
48
if (this.offset === this.uint8.length) {
- this.port.postMessage({ ended: true, currentTime, currentFrame });
- return false;
49
+ break;
50
51
uint8[i] = this.uint8[this.offset];
52
53
const uint16 = new Uint16Array(uint8.buffer);
54
CODECS.get(this.codec)(uint16, channels);
55
+ console.log(this.offset, this.index);
56
return true;
57
58
0 commit comments