The soundbank system in Wwise lets you do this by storing source files in a separate soundbank. For example, let's say you have the following sounds in Wwise:
- Sound A
- Sound B
- Sound C
And you have 2 game entities, one using sounds A and B, and one using sounds B and C. You will create 2 soundbanks that will contain the appropriate events:
- Bank 1
- Events for sound A
- Events for sound B
- Bank 2
- Events for sound B
- Events for sound C
By default, the banks will contain everything, including the source files, so the source files for sound B will be duplicated on disk (inside the soundbanks). If the game loads Banks 1 and 2, source files for sound B will be duplicated in memory.
To avoid this, you can:
- Exclude sound B's media data (WAV files) from banks 1 and 2.
- Create a new bank (let's call it DataBank) that contains just the media data (WAV files) for Sound B.
- In the game, whenever you load bank 1 or 2, also load DataBank (keep a "ref count" so if you load 1 AND 2, and then unload just one of them, you still keep DataBank loaded).
Another work around is to use the "Prepare Event" mechanism. You could have the exact same banks (Bank 1, Bank 2 and DataBank), but instead of loading DataBank explicitly, you call a function of the sound engine to "Prepare" events you're about to play (AK::SoundEngine::PrepareEvent()). Preparing an event consists of loading everything that it references. Sounds A and C don't really need it, since their data is already loaded with their banks, but Sound B's data would be automatically loaded from DataBank, without your game having to systematically track which data banks need to be loaded/unloaded. Note that there are drawbacks with using PrepareEvent(). Refer to the SDK documentation for more details.
This is just a quick example - there's more to this new soundbank system. If you want more information, look in the Wwise help under Finishing Your Project > Managing SoundBanks.