版本

menu_open
Wwise SDK 2023.1.4

◆ LoadBankMemoryCopy() [1/4]

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

Loads a bank asynchronously (from in-memory data, out-of-place, user bank only).
NOTE: Banks loaded from in-memory with out-of-place data must be unloaded using the standard UnloadBank function (with no memory pointer). Make sure you are using the correct UnloadBank(...) overload

Use LoadBankMemoryCopy 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, the media section of the bank will be copied into newly allocated memory. In-memory loading is out-of-place: the buffer can be released after the callback function is called. The advantage of using this over the in-place version is that there is no duplication of bank structures. A bank load request will be posted to the Bank Manager consumer thread. The function returns immediately.

返回
  • 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().
备注
  • The initialization bank 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.
参见
参数
in_pInMemoryBankPtrPointer to the in-memory bank to load (pointer is not stored in sound engine, memory can be released after callback)
in_uInMemoryBankSizeSize of the in-memory bank to load
in_pfnBankCallbackCallback function
in_pCookieCallback cookie
out_bankIDReturned bank ID

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅