Added option to always clear the cache of the last track when another track starts to greatly reduce memory usage.

This commit is contained in:
The Wobbler 2025-01-25 18:29:27 +01:00
parent cba4fd67fa
commit dc46ac07bb
5 changed files with 38 additions and 1 deletions

View file

@ -47,6 +47,13 @@ class Track:
self.cached = True
def clear_cache(self):
self.cached = False
self.audio = None
self.sound = None
self.duration = 0
def load_audio(self):
type = self.path.split(".")[-1]