Version

menu_open
Wwise Unity Integration Documentation
Build the Native Integration Plug-in from Source

The Wwise-Unity integration is a thin layer of C# calling the native Wwise API. It comes pre-built for all platforms. In most cases, it is unnecessary to rebuild the Integration plug-in. However, if you have the source code, you may want to customize it to integrate custom changes to the native sound engine or to modify the C++ code that interfaces with the sound engine. This should be done by a programmer who has some C++ knowledge.

The procedure

  1. Install the Wwise SDK for the platforms you wish to build using the Audiokinetic Launcher. Make sure to logoff and login again.
  2. Locate the source zip for the operating system you are using (Windows or Mac), it is installed in your Unity project by the Launcher when you add the Wwise integration to it (the zip is post-fixed with _Src.zip).
  3. Locate the source zip for the platform you wish to build (if different from Windows or Mac).
  4. Verify the prerequisites for building the Integration. See Prerequisites for details.
  5. Unzip the source zips, all in the same folder. See Installing or Upgrading the Integration in a Unity Project for details.
  6. Launch the build process using one of these two methods: Build using console utility or Build using Integrated Development Environment (IDE).
  7. Wait until the build finishes. If the build succeeds, the plug-ins and API binding under the API/Runtime/Plugin folder will be updated or created if none existed before.

Notes

  • During the build, you can monitor warnings, errors, or critical messages, if any, by reading the detailed log messages found in the Build Log.

Requirements to build the Integration yourself:

Platform Required Components
All platforms
Android
  • Android SDK: Minimum API 14 for 32 bits, Minimum API 21 for 64 bits..
  • Android NDK r17c.
  • Apache Ant 1.8.4.
  • The path to the Wwise SDK should not contain any white spaces.
  • The path to Unity project root should not contain any white spaces.
  • Environment variables:
    • ANDROID_HOME should point to the Android SDK root folder.
    • ANDROID_NDK_HOME should point to the Android NDK root folder.
    • NDKROOT should point to the Android NDK root folder.
    • ANT_HOME should point to the Apache Ant root folder.
iOS
  • Xcode 11 or above.
  • The Wwise SDK for iOS, and a WWISESDK environment variable pointing to it
Linux
  • Build-essential (sudo apt-get install build-essential)
  • The Wwise SDK for Linux, and a WWISESDK environment variable pointing to it
Mac
  • Xcode 11 or above.
  • The Wwise SDK for Mac, and a WWISESDK environment variable pointing to it
PS4 Visual Studio 2017 or above.
Windows Visual Studio 2017 or above.
Windows Store Visual Studio 2017 or above.
Xbox One Visual Studio 2017 or above.

How to install the source package

Unzip the source package. You can then rebuild and generate the content of the Integration using just the source package and a Wwise SDK installation for your target platforms. Optionally, you can merge the unzipped content under the Wwise folder with your imported Integration unity package in the Assets folder of your Unity project. However, this may generate unwanted intermediate files inside your Assets folder, which need to be cleaned up manually.

The folder structure of the installed Integration package

  • StreamingAssets: The folder used for automatic SoundBank deployment.
  • Wwise: The top-level folder.
    • API: The main Integration files used in your application.
      • Runtime: C++ to C# binding files. This is the translation of the native Wwise SDK.
      • Editor: Editor-only parts of the API.
      • Plug-ins: The Unity plug-in libraries of various configurations and debug symbol databases.
        • Platform
          • Architecture: Files shared by architectures of a multi-architecture platform.
    • MonoBehaviour: The Unity component scripts that can be used directly and serve as examples for custom components.
    • Documentation: The full documents about the Integration.

The folder structure of the installed source package

  • Wwise: The top-level folder.
    • AkSoundEngine: The source code and IDE projects needed for building the Integration, organized by platforms.
      • Common: The source code and build scripts used by all supported platforms.
      • Platform: The IDE solution or project, the source code, and platform-specific build scripts for the target platform.
    • Integration/Assets/Wwise/API: The main Integration files used in your application.
      • Runtime: The root-level folder of the API binding.
        • Generated: API binding files generated during the SWIG binding step.
        • Handwritten: API binding files written by hand.
    • MonoBehaviour: The factory Unity component scripts that can be used directly and serve as examples for custom components.

Build using console utility

You can build the Integration from the command line using the build script located at Wwise\AkSoundEngine\Common\BuildWwiseUnityIntegration.py. This is useful for continuous integration. To see the usage and examples, assuming your current working directory is the parent folder of the script, type in a command console on your computer:

python BuildWwiseUnityIntegration.py -h

Build using Integrated Development Environment (IDE)

Located in the Wwise Unity Integration source package under:

WwiseUnityIntegration_version_platform_Src.zip\Wwise\AkSoundEngine\YourPlatform

the solution (or Xcode project) allows you to build the Integration for the target platform in a supported IDE.

Building for the Mac or iOS platform with Xcode

When building the integration from the command line, the WWISESDK path is provided to Xcode automatically based on the one set in the environment variable $WWISESDK or the one provided to the build script using the -w option. When using the Xcode IDE however, the WWISESDK path must be set manually. To do so, open the Xcode project for either Mac or iOS platform and choose the AkSoundEngine{platform} project in the project navigator. Select the Build Settings page. At the bottom of the page, a User-Defined section with the WWISESDK setting key is present. Fill the value of the setting with the path of the WWISESDK to build the integration against (ex: /Users/myUser/Wwise/SDK ).

Building for the Linux platform

A makefile previously generated by premake5 is included. To build the Linux plug-in from source, simply enter the following commands into a terminal:

  • cd <Integration source location>/AkSoundEngine/Linux
  • make config=<config>

Where <config> is either debug_x64, profile_x64, or release_x64. The resulting plug-in will be located in <Integration source location>/API/Runtime/Plugins/Linux.

Deploy the new lib

The resulting binaries will be found in Wwise\API\Runtime\Plugins\[Platform]. If you haven't unzipped the sources in your Assets\Wwise directory, copy the new binaries from that folder to the corresponding folder in your project's Assets directory.

Under the hood

Prior to packaging the sources for building the integration code, we use SWIG to generate the API binding in the Unity for Wwise SDK. Most users will never need SWIG to work with Unity for Wwise. Even advanced users with access to the Wwise for Unity sources for building the integration code, which contains the converted APIs, do not need to install or use SWIG. The only exceptions to this are for integrating changes to the sound engine or modifying the C++ code that interfaces with it. In such rare cases, we recommend contacting support before proceeding.

The build process performs the following task:

  1. The Wwise SDK libraries are wrapped into a single library as the Unity plug-in, a dynamic library (.dll) on Windows, a loadable bundle (.bundle) on Mac OS X, a static library (.a) on iOS, or a shared library (.so) on Android. They are directly built into the Deployment folder. See Installing or Upgrading the Integration in a Unity Project for the folder structure.
See also

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise