I want create a piano keyboard. I'm wondering if it is better to load all of the sounds one sound per key. Something like:
local c = audio.loadSound(c.m4a)
local d = audio.loadSound(d.m4a)
etc.
Or would it be better to load the sounds as needed. Something like:
local function playNote( whichNote )
local note = audio.loadSound(whichNote)
audio.play(note)
end
From my limited experience with Corona it seems that the first method would load a lot of audio up front. But would avoid loading lags and possibly avoid memory leaks.
The second method would only be loading one sound at a time and so might make better use of memory. Though you'd be loading more sounds over time. If these didn't get flushed out of memory you might be using more memory in the long term.