litiengine icon indicating copy to clipboard operation
litiengine copied to clipboard

On sound data storage.

Open TheRamenChef opened this issue 5 years ago • 1 comments

Sounds loading, even on my 5-year-old computer, are very fast: 5+ minutes of compressed music can be loaded into the game in under 10 seconds. However, the uncompressed sound data is about 10 times the size of the compressed data, which is already more than 2MB. Should we really be storing the uncompressed audio data in the Sound class, or creating an AudioInputStream with the compressed data whenever the sound is needed?

TheRamenChef avatar Mar 25 '19 20:03 TheRamenChef

I don't know if this has already been implemented, but for any sounds longer than a few seconds that aren't used often, you generally should be streaming the data from the file. This has the added benefit of reducing memory usage and load times.

Gamebuster19901 avatar Feb 03 '21 18:02 Gamebuster19901