Redesign Smart Speed to dynamically adjust playbackRate instead of dropping samples, fix TimeMapper bugs by mapping audioContext to media time, and prevent SilenceMap memory leak by capping regions

This commit is contained in:
Jonathan Baldie 2026-05-01 21:47:34 +01:00
parent fa2460868e
commit 545c77a2dc
4 changed files with 32 additions and 314 deletions

View file

@ -38,6 +38,12 @@ class SilenceMap {
}
this._regions = merged
// Cap the number of regions to prevent memory leaks for long audiobooks
// Assuming each region is ~1 second, 5000 regions is over an hour of silence
if (this._regions.length > 5000) {
this._regions = this._regions.slice(-5000)
}
}
getCompressedOffset(atTimeMs, ratio) {