Fix for audio breaking after a certain time into the stream
After some time into the audio stream, the audio breaks and an error message is displayed in the console stating that the frame offset exceeds the total frames. `` caught RangeError: Failed to execute 'copyTo' on 'AudioData': Frame offset exceeds total frames (1024 >= 1024). `` This is my proposed solution to the issue. I have tested and verified that my fix works and the audio now runs smoothly without any break. Hope it helps :)
This commit is contained in:
parent
261d6927c1
commit
43af19ba94
|
@ -59,11 +59,15 @@ export class Ring {
|
|||
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
|
||||
if (first.length < second.length) {
|
||||
frame.copyTo(second, {
|
||||
planeIndex: i,
|
||||
frameOffset: first.length,
|
||||
frameCount: second.length,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,4 +144,4 @@ export class RingInit {
|
|||
|
||||
this.capacity = capacity
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue