Version

menu_open
Wwise SDK 2024.1.0

◆ LoadBankMemoryView() [1/4]

AKSOUNDENGINE_API AKRESULT AK::SoundEngine::LoadBankMemoryView ( const void *  in_pInMemoryBankPtr,
AkUInt32  in_uInMemoryBankSize,
AkBankCallbackFunc  in_pfnBankCallback,
void *  in_pCookie,
AkBankID out_bankID 
)

Loads a bank asynchronously (from in-memory data, in-place, user bank only).
IMPORTANT: Banks loaded from memory with in-place data MUST be unloaded using the UnloadBank function providing the same memory pointer. Make sure you are using the correct UnloadBank(...) overload

Use LoadBankMemoryView when you want to manage I/O on your side. Load the bank file in a buffer and pass its address to the sound engine. In-memory loading is in-place: *** the memory must be valid until the bank is unloaded. *** A bank load request will be posted to the Bank Manager consumer thread. The function returns immediately.

Returns
  • AK_Success if the scheduling was successful,
  • AK_InvalidBankType if the bank is not a user-defined bank.
  • AK_DataAlignmentError if the data pointer is not aligned properly Use a callback to be notified when completed, and get the status of the request. The bank ID, which is obtained by hashing the bank name (see GetIDFromString()). You may use this ID with UnloadBank().
Remarks
  • The initialization bank (Init.bnk) must be loaded first.
  • All SoundBanks subsequently loaded must come from the same Wwise project as the initialization bank. If you need to load SoundBanks from a different project, you must first unload ALL banks, including the initialization bank, then load the initialization bank from the other project, and finally load banks from that project.
  • Codecs and plug-ins must be registered before loading banks that use them.
  • Loading a bank referencing an unregistered plug-in or codec will result in a load bank success, but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects, posting the event will fail.
  • The memory must be aligned on platform-specific AK_BANK_PLATFORM_DATA_ALIGNMENT bytes (see AkTypes.h).
  • Avoid using this function for banks containing a lot of events or structure data: this data will be unpacked into the sound engine heap, making the supplied bank memory redundant. For event/structure-only banks, prefer LoadBankMemoryCopy().
See also
Parameters
in_pInMemoryBankPtrPointer to the in-memory bank to load (pointer is stored in sound engine, memory must remain valid)
in_uInMemoryBankSizeSize of the in-memory bank to load
in_pfnBankCallbackCallback function
in_pCookieCallback cookie
out_bankIDReturned bank ID

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise