Merge pull request #13 from wanjohiryan/patch-1

Fix for audio breaking after a certain time into the stream
This commit is contained in:
kixelated 2023-05-15 19:44:14 -07:00 committed by GitHub
commit 7bb6068951
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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,6 +61,7 @@ export class Ring {
frameCount: first.length, frameCount: first.length,
}) })
//console.log("frame offset", first.length , "frame count", second.length) to test
frame.copyTo(second, { frame.copyTo(second, {
planeIndex: i, planeIndex: i,
frameOffset: first.length, frameOffset: first.length,