Fix for endIndex == 0 breaking audio
The audio seems to break whenever endIndex goes to O, making "second" variable a ``bash Float32Array [buffer: SharedArrayBuffer(17640), byteLength: 0, byteOffset: 0, length: 0, Symbol(Symbol.toStringTag): 'Float32Array'] buffer:SharedArrayBuffer(17640) byteLength:0 byteOffset:0 length: 0 Symbol(Symbol.toStringTag): "Float32Array" [[Prototype]]:TypedArray ``
This commit is contained in:
parent
43af19ba94
commit
14bb3e80b1
|
@ -50,7 +50,9 @@ export class Ring {
|
||||||
planeIndex: i,
|
planeIndex: i,
|
||||||
frameCount: count,
|
frameCount: count,
|
||||||
})
|
})
|
||||||
} else {
|
//audio seems to be breaking whenever endIndex is 0
|
||||||
|
//this works, without "chopiness"
|
||||||
|
} else if (startIndex >= endIndex && endIndex != 0) {
|
||||||
const first = channel.subarray(startIndex)
|
const first = channel.subarray(startIndex)
|
||||||
const second = channel.subarray(0, endIndex)
|
const second = channel.subarray(0, endIndex)
|
||||||
|
|
||||||
|
@ -59,15 +61,12 @@ export class Ring {
|
||||||
frameCount: first.length,
|
frameCount: first.length,
|
||||||
})
|
})
|
||||||
|
|
||||||
//For some reason this breaks audio... and this is my temporary fix
|
|
||||||
//console.log("frame offset", first.length , "frame count", second.length) to test
|
//console.log("frame offset", first.length , "frame count", second.length) to test
|
||||||
if (first.length < second.length) {
|
|
||||||
frame.copyTo(second, {
|
frame.copyTo(second, {
|
||||||
planeIndex: i,
|
planeIndex: i,
|
||||||
frameOffset: first.length,
|
frameOffset: first.length,
|
||||||
frameCount: second.length,
|
frameCount: second.length,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue