Version
menu_open

Streaming Your Music

You can determine which pieces of music will be played from memory and which ones will be streamed from the DVD, CD, or hard drive. When music is streamed from the disk or hard drive, you also have the option to avoid any playback delays and syncing problems by using a combination of the following:

  • Look-ahead time - Which reserves a specific amount of time so the sound engine can seek the streaming data. This time defines the latency of the track.

  • Prefetch - Which creates a small audio buffer that covers the latency time required to fetch the rest of the file.

You can specify the amount of look-ahead time and prefetch size so that the requirements of the different media sources, such as hard drive, CD, and DVD are met. A prefetch size that is too small will result in latency and one that is too large will take up too much memory. A look-ahead time that is too small will result in de-synchronizing of music tracks within a segment, whereas a look-ahead time that is too large will result in playback delays. You will need to experiment with the prefetch size and look-ahead times to find the right balance between latency and synchronization of your music clips.

The look-ahead time and the prefetch settings can be used together to reduce the chance of de-synchronization and voice starvation when streaming music in your game. For example, when the sync point for a piece of music is not at the very beginning of the segment or you've chosen not to use the pre-entry portion of the segment, the prefetch data loaded into memory can not be used, so Wwise will use the look-ahead time instead.

[Note] Note

Audio playback within the Wwise authoring application is always streamed regardless of whether the streaming options have been selected. As a result, music objects that are not streamed in game will still be streamed when played back in Wwise. To avoid de-synchronization of music tracks and voice starvation while playing back these music objects in Wwise, you may need to define an internal playback look-ahead time. For more information on setting an internal playback look-ahead time, refer to Setting the Music Track Look-ahead Time.

To stream a music track:

  1. Load a music track into the Property Editor.

  2. Select the Stream option.

    The Stream controls become available.

  3. In the Look-ahead time text box, type the number of milliseconds that you want to reserve so the sound engine can seek the streaming data. This time defines the latency of the track, so if you specify a value of 100 milliseconds, the music will be heard only 100 milliseconds after pressing Play.

    [Note] Note

    When Wwise seeks the data for a segment that has several tracks with different look-ahead times, Wwise will use the longest look-ahead time of the tracks that have a source to play.

  4. Select the Zero Latency option to have no delay from the time the music is triggered to when it is actually played.

  5. To achieve zero latency, a certain portion of the beginning of the sound must be stored in memory to cover the latency time required to fetch the rest of the audio file from the media drive. In the Prefetch length text box, type the number of milliseconds of the music that you want to store in memory.

    [Note] Note

    Prefetch settings are set per track, so if you have more than one music source on a track, then the beginning portion all sources on the track will be loaded into memory.


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