버전
menu_open
Wwise SDK 2018.1.11
Advanced Sound Engine Integration

Sound Engine Initialization

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
//
{
assert( ! "Could not initialize the Sound Engine." );
return false;
}
return true;
}

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.

Customizing the Creation Parameters

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.

#include <AK/SoundEngine/Common/AkSoundEngine.h> // Sound Engine
(...)
bool InitSoundEngine()
{
(...)
//
// Create the Sound Engine
// Using modified initialization parameters
//
AkInitSettings initSettings;
AkPlatformInitSettings platformInitSettings;
initSettings.uDefaultPoolSize = 4 * 1024 * 1024; // 4 MB
initSettings.uMaxNumPaths = 16;
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.


이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요