Skip to content

Commit

Permalink
fix: Correct syntax errors in PCM processor
Browse files Browse the repository at this point in the history
  • Loading branch information
heiko-hotz committed Dec 20, 2024
1 parent 8dd5ce2 commit 2d0685d
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
/**
* @class PCMProcessor
* @extends AudioWorkletProcessor
* @description Processes PCM audio data in a Web Audio API context
*/
class PCMProcessor extends AudioWorkletProcessor {
constructor() {
super();
this.buffer = new Float32Array();

/**
* @class PCMProcessor
* @extends AudioWorkletProcessor
* @description Processes PCM audio data.
*/
this.port.onmessage = (e) => {
const newData = e.data;
const newBuffer = new Float32Array(this.buffer.length + newData.length);
newBuffer.set(this.buffer);
newBuffer.set(newData, this.buffer.length);
this.buffer = newBuffer;
};
const newData = e.data;
const newBuffer = new Float32Array(this.buffer.length + newData.length);
newBuffer.set(this.buffer);
newBuffer.set(newData, this.buffer.length);
this.buffer = newBuffer;
};
}

process(inputs, outputs, parameters) {
Expand Down

0 comments on commit 2d0685d

Please sign in to comment.