pub fn load_bank_by_name<T: AsRef<str>>(name: T) -> Result<AkBankID, AkResult>
Expand description

Load a bank synchronously (by Unicode string).

The bank name is passed to the Stream Manager.

A bank load request will be posted, and consumed by the Bank Manager thread.

The function returns when the request has been completely processed.

Return The bank ID (see [get_id_from_string]). You may use this ID with [unload_bank].

Remarks

  • 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 get_id_from_string(name) 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.

See also

  • [unload_bank_by_name]
  • [unload_bank_by_id]
  • [clear_banks]
  • [get_id_from_string]