menu
Wwise
arrow_drop_down
Strata
arrow_drop_down
Solutions
arrow_drop_down
Apprendre
arrow_drop_down
Communauté
arrow_drop_down
Documentation
arrow_drop_down
Aide
arrow_drop_down
2024.1.6.8842
2023.1.14.8770
2022.1.19.8584
2021.1.14.8108
2019.2.15.7667
2019.1.11.7296
2018.1.11.6987
2017.2.10.6745
2017.1.9.6501
2016.2.6.6153
2015.1.9.5624
info
|
Note: Before initializing the sound engine itself, the memory manager and streaming manager must be initialized. Please refer to the section Initialize the Different Modules of the Sound Engine for more information about global initialization. |
Initializing the sound engine itself is done by calling the AK::SoundEngine::Init function. The default initialization shown in Initializing the Sound Engine is copied here for your convenience.
#include <AK/SoundEngine/Common/AkSoundEngine.h> // Sound Engine (...) bool InitSoundEngine() { (...) // // Initialize the sound engine // Using default initialization parameters // if ( AK::SoundEngine::Init( NULL, NULL ) != AK_Success ) { assert( ! "Could not initialize the Sound Engine." ); return false; } return true; }
The AK::SoundEngine::Init function takes 2 parameters.
First parameter : AkInitSettings * in_pSettings
Second parameter : AkPlatformInitSettings * in_pPlatformSettings
warning
|
Caution: Both parameters are considered optional, but we strongly recommend you customize these values to the needs of the game, because the default values often require high memory usage. Depending on the game type, memory settings should be adjusted carefully. Refer to the section Determining an Appropriate Size for Your Memory Pools for more information. |
The AkInitSettings and AkPlatformInitSettings structures must be initialized using the AK::SoundEngine::GetDefaultInitSettings and AK::SoundEngine::GetDefaultPlatformInitSettings functions.
Initializing the structure using these two functions fills the structures with the default parameters. This is useful because:
The following sample code demonstrates how to initialize the two main pools of the sound engine.
#include <AK/SoundEngine/Common/AkSoundEngine.h> // Sound Engine (...) bool InitSoundEngine() { (...) // // Create the Sound Engine // Using modified initialization parameters // AkInitSettings initSettings; AkPlatformInitSettings platformInitSettings; AK::SoundEngine::GetDefaultInitSettings( initSettings ); AK::SoundEngine::GetDefaultPlatformInitSettings( platformInitSettings ); initSettings.uDefaultPoolSize = 4 * 1024 * 1024; // 4 MB initSettings.uMaxNumPaths = 16; initSettings.uMaxNumTransitions = 128; platformInitSettings.uLEngineDefaultPoolSize = 4 * 1024 * 1024; // 4 MB if ( AK::SoundEngine::Init( &initSettings, &platformInitSettings ) != AK_Success ) { return false; } return true; }
For more information on choosing memory pool sizes, refer to Optimizing Memory Pools
Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !
Visitez notre page d'AideEnregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !
Partir du bon pied avec Wwise