Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Basic question about looping music files.  (Read 3625 times)

0 Members and 1 Guest are viewing this topic.

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Basic question about looping music files.
« 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
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Basic question about looping music files.
« Reply #1 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);
}

Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Basic question about looping music files.
« Reply #2 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
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Basic question about looping music files.
« Reply #3 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? ;)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Basic question about looping music files.
« Reply #4 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
Logged
 

Page created in 0.016 seconds with 20 queries.