版本

menu_open
Wwise SDK 2022.1.13

◆ LoadBank() [4/4]

AKSOUNDENGINE_API AKRESULT AK::SoundEngine::LoadBank ( const char *  in_pszString,
AkBankID out_bankID,
AkBankType  in_bankType = AkBankType_User 
)

Loads a bank synchronously.
The bank name and type are passed to the Stream Manager. Refer to 一般信息 for a discussion on using strings and IDs. A bank load request will be posted, and consumed by the Bank Manager thread. The function returns when the request has been completely processed.

返回
The bank ID, which is obtained by hashing the bank name (see GetIDFromString()). You may use this ID with UnloadBank().
  • AK_Success: Load or unload successful.
  • AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  • AK_InsufficientMemory: Insufficient memory to store bank data.
  • AK_BankReadError: I/O error.
  • AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that you used to generate the SoundBanks matches that of the SDK you are currently using.
  • AK_InvalidFile: File specified could not be opened.
  • AK_NotInitialized if the sound engine was not correctly initialized
  • AK_InvalidParameter if some parameters are invalid, check the debug console
  • AK_InvalidBankType if the bank type parameter is out of range.
  • AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
备注
  • 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.
  • The sound engine internally calls GetIDFromString(in_pszString) to return the correct bank ID. Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally), not the name of the file (if you changed it), nor the full path of the file. The path should be resolved in your implementation of the Stream Manager, or in the Low-Level I/O module if you use the default Stream Manager's implementation.
参见
参数
in_pszStringName of the bank to load
out_bankIDReturned bank ID
in_bankTypeType of the bank to load

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅