Wwise SDK 2021.1.11
The Wwise SDK headers require a valid C++11 (or later) compiler. Make sure your compiler can parse C++11 code. See Platform Requirements for a list of supported compilers.
You must define the
AK_OPTIMIZED symbol in the Release configuration of your project (it might be called "Ship", "Retail", and so on in the configuration that is used to build the retail version of your game).
This symbol is used in various places to avoid compiling some code in the Release version.
The Wwise sound engine lets you enable communication between Wwise and you game so the Wwise user can perform in-game mixing and profiling. However, this communication is not available in the release configuration for performance reasons.
If you enable communication in your game, that code should be excluded from the Release version of your game by surrounding it with
#ifndef AK_OPTIMIZED /
If you call one or many functions of the Wwise sound engine that use the wchar_t type, you need to enable the "Treat wchar_t as Built-in type" option in your project's settings for proper linking to the sound engine libraries. To do so, go to Configuration Properties > C/C++ > Language, and set "Treat wchar_t as Built-in Type" to "Yes". This will specify the "/Zc:wchar_t" compile flag.
However, this is not required if you do not call any of the functions of the sound engine that use the wchar_t type. Note that all these functions have a counterpart that use the char type instead.
If you call a function that uses wchar_t, but omit to enable the "Treat wchar_t as Built-in Type" setting in your project, you will get a link error similar to this one: unresolved external symbol "enum AKRESULT __cdecl AK::SoundEngine::LoadBank(unsigned short const *,long,unsigned long &)", the function AK::SoundEngine::LoadBank(const wchar_t *,long,unsigned long &) being erroneously interpreted as AK::SoundEngine::LoadBank(unsigned short const *,long,unsigned long &) by the compiler.
Warning: We recommend that you enable the "Treat wchar_t as Built-in Type" setting in your project. If you do not want to enable it, please read the following.
You need to pay special attention to the AkOSChar type, which is typedef'd to wchar_t on some platforms. This type is used with methods that involve disk I/O. More specifically, it is used by the Stream Manager (AK::IAkStreamMgr) and Low-Level I/O (AK::StreamMgr::IAkFileLocationResolver) interfaces.
If Audiokinetic's default Stream Manager is used as your I/O manager throughout your game, you will not have any choice but to enable the "Treat wchar_t as Built-in Type" setting on platforms where AkOSChar are typedef'd to wchar_t. Typically, though, the Wwise sound engine is the only client of the Stream Manager. In such a case it is not necessary to enable the "Treat wchar_t as Built-in Type" setting in your project.
The "Treat wchar_t as Built-in Type" setting is not problematic with the Low-Level I/O API, since you don't typically call it, but implement it instead.
Note that the File Package Low-Level I/O sample (see File Package Low-Level I/O Implementation) calls some methods of the sound engine that use the wchar_t type when AkOSChar is typedef'd to wchar_t. If you wish to use this sample in your project without enabling the "Treat wchar_t as Built-in Type" setting, you will have to modify some parts of it to make the appropriate conversions of wchar_t strings into char strings everywhere this is needed. You may use the AKPLATFORM::AkWideCharToChar() helper to do so. It is defined in AK/Tools/Common/AkPlatformFuncs.h.
For more information on how to integrate Wwise regarding I/O, refer to Streaming / Stream Manager.
In a Windows game, if you are using a DLL to wrap everything that is related to the Wwise sound engine, such as the sample AkSoundEngineDLL project (see below), you need to define AKSOUNDENGINE_DLL in the project that depends on it (game executable or another DLL) to correctly import the symbols of the sound engine API.
Projects that link statically with the Wwise sound engine's libraries must not define AKSOUNDENGINE_DLL.
This Sound Engine Integration Walkthrough guides you through a basic integration, step by step, involving the initialization and handling of several modules individually. If you prefer to work with a sample DLL project, one is included in the SDK. The AkSoundEngineDLL project wraps some of the integration tasks into high-level calls, like "Initialize" and "Terminate". It is not used in this example so you can view each step individually, but you can use the DLL, or a modified version of it, in your own game. Refer to the AkCube Sound Engine Integration Sample Project for an example of how to use that DLL.
|Note: It is necessary to install the Visual Studio 2017 package in order to use AkSoundEngineDLL on Windows.|
Note that the AkSoundEngineDLL project also contains an implementation of the Low-Level I/O, which you can replace by yours if desired. For more information on the Low-Level I/O, refer to Low-Level I/O.