Version
Each music track within your project has a certain set of behaviors. The behaviors determine how a music track and its sub-tracks are played back and whether the music on the track is stored in memory or streamed directly from the media or hard drive.
You can define the following behaviors for a music track:
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 desynchronization 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 desynchronization 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 | |
---|---|
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 desynchronization 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:
Load a music track into the Property Editor.
Select the Stream option.
The Stream controls become available.
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 | |
---|---|
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. |
Select the Zero Latency option to have no delay from the time the music is triggered to when it is actually played.
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 | |
---|---|
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. |
To add variety to the music in your game, you can define the playback type for each of the tracks within a segment. You can have a normal track, which simply plays the same track each time the segment is called, or you can create random or sequence tracks. Random step and sequence step tracks can have an unlimited number of sub-tracks, which allow you to play a different piece of music each time the track is played.
The following illustration shows you the differences in playback behavior between the three track types.
By using a combination of the three types of tracks, you can give the impression that a new piece of music is played each time the segment is called by the game. For example, you can build a Music Segment that has four random step tracks, each of which has four sub-tracks. When the Music Segment is called by the game, you can have 256 different variations of the same music.
To define the track playback type:
Load a music track into the Property Editor.
From the Track Type group, select one of the following options:
Normal to play the current track each time the parent segment is played. Sub-tracks can't be added when in Normal mode.
Random Step to play one of the sub-tracks in a random order each time the parent segment is played.
Sequence Step to play one of the sub-tracks in sequential order each time the parent segment is played.
Switch to select witch sub-track(s) to play.
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageRegister your project and we'll help you get started with no strings attached!
Get started with Wwise