Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Mikael on May 02, 2008, 05:10:58 PM

Title: Basic question about looping music files.
Post by: Mikael on May 02, 2008, 05:10:58 PM
Which is the easiest way to loop two separate music files after one another (that is, alternating between them)?

Thanks,

Mikael
Title: Re: Basic question about looping music files.
Post by: metamorphium on May 02, 2008, 05:13:02 PM
putting them as one file and looping it :D

Game.AttachScript("alternate_looper.script");

where the script file would look like something like this:

while(1)
{
   Game.PlayMusic("some ogg file");
   while (Game.IsMusicPlaying()) Sleep(500);
   Game.PlayMusic("another ogg file");
   while (Game.IsMusicPlaying()) Sleep(500);
}

Title: Re: Basic question about looping music files.
Post by: Mikael on May 02, 2008, 06:08:31 PM
Quote
putting them as one file and looping it  ;D

I've done that one or two times in the past.

Thanks!

Mikael
Title: Re: Basic question about looping music files.
Post by: metamorphium on May 02, 2008, 06:27:19 PM
of course by modifying my previous code you can make playlists as well. (but with 3 and more files I'd already choose some object logic how to add new files to the playlist etc.). How's good ole Carol Reed doing? ;)
Title: Re: Basic question about looping music files.
Post by: Mikael on May 03, 2008, 03:27:47 AM
Carol is doing fine, thank you. She's currently being translated to German, Japanese, and Russian, which, unexpectantly, has lead to some hard work for her. But she's had time to tell me all about her latest adventure, which is currently in the works.

Mikael