Skip to content

Commit

Permalink
Revert "Change browser audio format"
Browse files Browse the repository at this point in the history
This reverts commit e9109b5.
  • Loading branch information
mikegapinski committed Jun 24, 2024
1 parent 5d78275 commit 0dd5aa1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions web/pcmplayer-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,10 @@ class PCMPlayerProcessor extends AudioWorkletProcessor {

getFormattedValue(data) {
if (data.constructor == ArrayBuffer) {
data = new Int16Array(data);
return new Float32Array(data);
} else {
data = new Int16Array(data.buffer);
return new Float32Array(data.buffer);
}

let float32 = new Float32Array(data.length);

for (let i = 0; i < data.length; i++) {
float32[i] = data[i] / 32768;
}
return float32
}

process(inputs, outputs, parameters) {
Expand Down

0 comments on commit 0dd5aa1

Please sign in to comment.