menu
 

Wwise Fundamentals

Table of Contents

Stream audio

Another way to reduce memory usage is to load only part of an audio file into the game system’s RAM at one time. This is known as streaming. Streaming provides a way to play audio directly from the stored memory, such as an optical disc or hard drive. Streaming is particularly effective for large audio files that can be several minutes long, such as music.

The downside of streaming is that when the game engine calls for the sound, there might be a slight delay, known as latency, before the sound starts to play. This is because it takes time to locate the file and begin the stream. The delay might be noticeable for something like the firing of an ice gem, but it's fine for things that play continuously like background music.

Another downside of streaming is that there are limits to the total amount of data that can be read from the stream at one time, and it’s possible there are other aspects of the game, such as video, competing for bandwidth on that stream.

The background music in Cube is included in the DCP_the_core SoundBank, which is currently over its memory budget. You'll try streaming the music to see if that helps.

  1. In the Project Explorer, select the Cube Main Theme object.

  2. In the Property Editor, select Sound SFX, and then under the Stream group, click Enable.

    Now you'll regenerate the SoundBanks to see if you have saved enough memory by excluding some objects and streaming the main theme.

  3. From the menu bar, click Layouts > SoundBank (F7), and then click Generate All.

  4. When the process is done, in the Generating SoundBanks dialog, click Close.

    In the SoundBank Manager, you can see that streaming the music had a significant impact. The DCP_the_core SoundBank, which was over 26,000,000 bytes, is now using less than half of the 6,000,000 byte budget. The size of the Main SoundBank has also decreased slightly because you excluded a few objects from it.

  5. From the menu bar, click Layouts > Designer (F5) so you're ready to start another module.

Well done! You finished module 19, successfully bringing the size of both of your SoundBanks within your memory budget. You started by assigning a maximum size to each SoundBank so that Wwise would warn you when that size was exceeded. Then you converted several of your audio files to Vorbis format, which takes less space. Then you excluded some Sound SFX objects from Random Containers. This reduced variety, but not in a significant way. And finally, you chose to stream the main theme music, because streaming takes less memory, and the latency introduced is negligible for music.

Up next, Module 20: Optimizing your sound design where you'll learn to monitor and optimize your game's performance.


Was this page helpful?