Consolidate audio

I have a game with a large library of sounds.

Is it possible to keep all of these sounds in one file, say soundEffects.mp3, and play the appropriate sound by referencing the time in the file the sound is found at (like tracks on a cd)?

In every other audio containing piece of software I have written, this is actually the preferred method for integrating. The sound file is loaded one time, and then played by referencing the start and stop time within the file. This saves on both virtual resources as well as file size (to a small extent).

Any guidance would be appreciated.

Regards.

Hi @larry97,

Yes, this should be possible, although I would caution you that loading a really large/immense sound file (like a “CD”) would likely cause an up-front performance hit, so you’d need to ensure that happened at a point where the user wouldn’t notice it.

As for finding a certain point in the audio file, see this API:

https://docs.coronalabs.com/api/library/audio/seek.html

Take care,

Brent

Hi @larry97,

Yes, this should be possible, although I would caution you that loading a really large/immense sound file (like a “CD”) would likely cause an up-front performance hit, so you’d need to ensure that happened at a point where the user wouldn’t notice it.

As for finding a certain point in the audio file, see this API:

https://docs.coronalabs.com/api/library/audio/seek.html

Take care,

Brent