版本
Wwise SDK 2023.1.4
|
The following sections contain sample integrations of various SoundBank management strategies. These strategies are described in Strategies for Managing SoundBanks in the Wwise help.
备注: PrepareEvent 和 LoadBank 不可共用,因为两者都会将数据加载到内存中。 |
With this strategy, all event content, sound structure data, and media files are stored in one SoundBank. For a discussion of this strategy and its implementation in Wwise Authoring, see The All-in-one SoundBank in the Wwise Help.
Since there is only one SoundBank for this game, load it when initializing the game. As always, the sound engine must be initialized first.
This strategy works well for single player games, where all possible sounds depend on the location of the player in the game. For a discussion of this strategy and its implementation in Wwise Authoring, see Multiple Complete SoundBanks in the Wwise Help.
In the game, load the correct bank at the correct time. 例如,游戏可以在开始时加载通用 SoundBank ,然后根据游戏中玩家的实际位置加载其它 SoundBank 。Note that some games will need to have enough memory to load more than one "level" at a time to allow for transitions between levels.
As an alternative to LoadBank()
, you could prepare your SoundBanks using AkBankContent_All. This has the advantage of avoiding duplicating media in memory. See 对 SoundBank 做 Prepare 操作.
Consider this strategy for complex games with many assets. For a discussion of this strategy and its implementation in Wwise Authoring, see Micromanaging Media in the Wwise Help.
In the game, load the common SoundBanks at the beginning of your game then load the other SoundBanks when they are required. For example, the game could load the Event SoundBank and the common footsteps SoundBank at the beginning, then load the other SoundBanks based on the player's location in the game.
Consider this strategy if you require a high level of media granularity to keep memory usage low and do not want to manage the structure and media related to Events. For a discussion of this strategy and its implementation in Wwise Authoring, see Preparing Action Events in the Wwise Help.
In the game, load the Events' SoundBank at the beginning of the game, then prepare the Events when they are required in game. The corresponding structures and media will be loaded automatically.
This strategy is like Preparing Action Events, but with more control over the media that gets loaded when Events are prepared. For a discussion of this strategy and its implementation in Wwise Authoring, see Preparing Events and Game Syncs (Switches and States) in the Wwise Help.
The order in which you call AK::SoundEngine::PrepareEvent
and AK::SoundEngine::PrepareGameSync
is not important. Each time the state changes, the media pool is updated by crossmatching the Events and the game syncs.