Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Snake on Thu 14/08/2003 05:33:34

Title: Loop a soundtrack of mids/wavs/mp3s?
Post by: Snake on Thu 14/08/2003 05:33:34
I thought of this earlier today, although I won't need it for my current games, but thought it would be very useful for other users.

A command that would loop specified music/SFX files is what I'm thinking about. Something like:

PlaySndtrack(music1, music2, music3, music4, music5);

I think this would be useful for Vegetable Patch Turbo Extreem games, shooters and so on. It could even be used for let's say, if the programmer wanted to have a soundtrack loop for a music store or something in their game. It could even be used for sound effects...

Just an idea I came up with today. It could most likely be done with scripting anyway, but just thought I'd bring it up :)


--Snake
Title: Re:Loop a soundtrack of mids/wavs/mp3s?
Post by: Fuzzpilz on Thu 14/08/2003 05:41:25
Could be done with IsMusicPlaying relatively easily, I'd say.
Title: Re:Loop a soundtrack of mids/wavs/mp3s?
Post by: Pumaman on Fri 15/08/2003 17:17:02
It's possible, though as Fuzz says it's quite easy with scripting ... would anyone else find this useful as a built-in command?
Title: Re:Loop a soundtrack of mids/wavs/mp3s?
Post by: Pet Terry on Fri 15/08/2003 18:18:38
I would find it useful for my game in production.
Title: Re:Loop a soundtrack of mids/wavs/mp3s?
Post by: Snake on Sun 17/08/2003 03:51:40
I'm sure if the Captain saw this he might find it useful, although I'm not him so I wouldn't know ;)
Once I work on my NES style game again, I know I'd use it.


--Snake
Title: Re:Loop a soundtrack of mids/wavs/mp3s?
Post by: Captain Mostly on Sun 17/08/2003 07:40:36
this WOULD be useful!

The problem with IsMusicPlaying is that it always leaves a noticable gap at the end of the loop (I tried to use it)

As such, in VPXT2 I tried to used a counter, and worked out how many cycles long my pieces of music were, and set them so the next one started playing about 1 cycle before the last one stopped.

I don't know how well this worked on computers older than mine (which isn't very old) although I DID ask in the announcement thread, but saddly no one ever answered!!  :'(

Did it work? I think that it sometimes takes a while to warm up (on my computer, it often seemes that the first time it playes any of the music samples, it loads it up slightly slower...) but I'm a little concerned that maybe on older machines there was always a gap between samples.

The suggested command on this thread would be useful, although only if you could have a command like IsLoopEnd() that told you YES if you were at the loop-point (i.e. the end of one sound and the start of another, being seamlessly strung together). This way you could use the music as a reference point for stuff in the game.

I suspect this wouldn't have broad enough appeal to be introduced though...
Title: Re:Loop a soundtrack of mids/wavs/mp3s?
Post by: Pumaman on Sun 17/08/2003 17:42:44
Ok, I'll add it to my to-do list :)
Title: Re:Loop a soundtrack of mids/wavs/mp3s?
Post by: on Tue 19/08/2003 12:26:56
It'd deffinatley be useful if it could be used globally and also singular. For example, at one point in a game, you might come across a band, and they might have a music set song1, song2, song3 etc.

Yes, it'd be handy!

m0ds