mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-17 17:01:30 +00:00
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:
parent
fa2460868e
commit
545c77a2dc
4 changed files with 32 additions and 314 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue