Question

I am writing a cross-platform game (Android, iOS, PC) where the player gets to record his own voice through the microphone. This results in big amounts of data even if LZMA compressed.

For my comfort, I am using the SharedObject. My question is, what happens if I fill it with tens of megabytes of data?

When I issue SharedObject.getLocal(xxx), does it load all its megabytes at that exactly point (slow and filling-up memory as well)? Or does it only load accessed data e.g var data:* = SharedObject.getLocal(xxx).data[recordingName];

If it isn't optimized in the way that I need it, would there be a problem if I had a different SharedObject for each file - accessed like

var so:SharedObject = SharedObject.getLocal(recordingName);

?

Was it helpful?

Solution

The data gets loaded when SharedObject.getLocal(xxx) is issued.

So in your case Bill, you should have a separate SharedObject for each of your samples. That way, you won't have to wait for all of them to be loaded at once.

Hopefully, the runtime will garbage collect the SharedObjects after you have used them and no longer have pointers to them, so that they won't take up all your RAM eventually..!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top