From 4ece0d79210c0f0351c16a0611f40308ceb8efb0 Mon Sep 17 00:00:00 2001 From: bmdhacks Date: Thu, 13 Feb 2025 16:01:47 -0800 Subject: Streaming Audio Problem: The current implementation reads the entire sound file in to memory in order to play it. For OGG background music, this uses 91 Megs of RAM by injesting all ogg songs as well as all wav assets. Solution: Change StarAudio to play the asset from a file handle and stream it off the disk. This results in a massive savings of RAM and doesn't really affect audio quality unless you're doing massive disk operations such as compiling Starbound. --- source/core/StarCompression.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/core/StarCompression.hpp') diff --git a/source/core/StarCompression.hpp b/source/core/StarCompression.hpp index 3322662..5ffe791 100644 --- a/source/core/StarCompression.hpp +++ b/source/core/StarCompression.hpp @@ -49,6 +49,8 @@ public: void sync() override; void close() override; + IODevicePtr clone() override; + private: String m_filename; void* m_file; -- cgit v1.2.3