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.
The AK::SoundEngine::Init function takes 2 parameters.
First parameter : AkInitSettings * in_pSettings
- This structure contains platform-independent information to initialize the sound engine.
Second parameter : AkPlatformInitSettings * in_pPlatformSettings
- This structure contains information specific to each platform to initialize the sound engine.
|
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:
- Once initialized, the parameters that need to be modified can easily be changed to fit the needs of the game.
- Using default parameters ensures code backward compatibility, since later versions of the SDK may add more initialization parameters to the structures.
The following sample code demonstrates how to initialize the two main pools of the sound engine.
For more information on choosing memory pool sizes, refer to Optimizing Memory Pools