Leçon 7

Table des matières

Managing Reserved Memory

The size of the memory pools is set in the Unity Project with a Wwise Initialization Settings Asset file. This file is included in the Wwise Unity Integration and can be located either from Unity's Project window, from the Unity menu > Edit > Project Settings > Wwise Initialization Settings, or from the AkInitializer component inside a Scene. Let's locate the AkInitializer component.

  1. Make sure you're in the Memory Pool Scene, if not, in the Audiokinetic menu go to Certification > 251 > Lesson 7 and select Memory Pools Scene.

  2. In the WAG Unity project, go to the Hierarchy view and select the WwiseInitalizer game-object from the list.

    In the Inspector, take a look at the AkInitializer component.

    [Note]

    If you do not see the contents of the AkInitializer, you can click the drop-down arrow to open it.

    There can be only one AkInitializer in any scene and it will always reference the AkWwiseInitializationSettings Asset file. As such, making changes to it will influence all scenes in the Unity Project. Let's open it.

  3. In the Inspector, double-click the AkWwiseInitializationSettings Asset file.

    The AkWwiseInitializationSettings Asset file will now be displayed in the Inspector. To an unfamiliar eye, the abundance of settings might seem quite daunting, but once you know where to look, you will favor the level of control you have with your resources. Let's break up the Asset file so you will know which properties will be relevant throughout this lesson.

    Default"

    Memory Cutoff Threshold

    Streaming Manager

    Lower Engine Default

    Monitor

    Monitor Queue

    In the previous section, you estimated the Default and Lower Engine Default Memory Pools. Let’s now use the estimates in their respective Memory Pool properties. Good practice is to give a certain headroom, in case of unforeseen scenarios. Add another 25% to your estimates before assigning the values (1.1 MB + 25% rounded up = 1.4 MB).

  4. Set the Default Pool Size to your Default estimate (Suggested Default Pool Size: 1 400 000).

  5. Set the Lower Pool Size to your Lower Engine Default estimate (Suggested Default Pool Size: 6 600 000).

    Let’s now Profile again and monitor the Memory reserved, but before doing so, notice the warning message in the top of the Inspector.

    When loading a scene in Unity, the Wwise Sound Engine will automatically initialize so that you can connect to the game or play sounds without being in playmode. So when you enter playmode, the changes in the AkWwiseInitializationSettings will not have been applied yet. To do so, you will have to stop the sound engine by either entering and exiting playmode or load the scene again.

  6. In the WAG Unity project, click Play.

  7. Open the WAG menu, then click Play to exit the playmode.

    The sound engine will now initialize with the new AkWwiseInitializationSettings Asset settings. Let's now connect from Wwise and monitor the memory pool changes.

  8. In the WAG Unity project, click Play.

  9. In the Wwise toolbar, click Reconnect.

  10. Teleport to the Core.

  11. Click Play to exit the playmode.

  12. In the Profiler layout’s Advanced Profiler dialog, select the Memory tab.

    In the Reserved column, you will see the size of the memory pools you just assigned. In the Ratio Used column you will be able to see how much of your estimated Memory Pool size you’ve used.


Cette page a-t-elle été utile ?