Lesson 7

Table of Contents

Streaming

Another way to reduce memory is to not load the entire audio file into the game system’s RAM all at one time. Instead, streaming provides a way in which the audio can be played directly from the stored memory, such as an optical disc or hard drive. This option provides game developers with another strategy for how they can manage memory. The use of streaming varies depending on the technical needs of each game, but 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 may be a pause before the sound starts playing because it takes time to locate the file and begin the stream. This would not work well for the firing of the ice gem, but would be fine for things like continuously playing ambience or music. Another limitation of streaming is that there are technical limits to the total amount of data that can be read from the stream at one time and it’s possible that there are other aspects of the game, such as video, that may be competing for bandwidth on that stream.

For Cube, streaming provides a way to fix the issue of the DCP_the_core SoundBank being over its memory budget. Remember that the Cube Main Theme music is triggered by the DCP_Music event, added earlier in this lesson to the DCP_the_core SoundBank, which is currently over its memory budget. Streaming the music is a great way to reduce memory usage, and it does so without changing the sound quality.

  1. Select the Designer layout, choose the Cube Main Theme object and make sure that the Property Editor’s General Settings tab is selected.

  2. In the Property Editor, select the Stream check box.

    Other streaming properties now appear, but it’s not necessary to change these parameters unless you want to minimize the latency it takes to start the stream.

    To see the memory savings you have acquired by not including some objects as well as streaming, you need to generate your SoundBanks in the SoundBank layout.

  3. Choose the SoundBank layout and click Generate All.

    You can see that streaming the music has had a significant impact. The DCP_the_core SoundBank, which was over 29,000,000 bytes, is now using less than half of the 6,000,000 byte budget.


Was this page helpful?