Loop a soundtrack of mids/wavs/mp3s?

Started by Snake, Thu 14/08/2003 05:33:34

Previous topic - Next topic

Snake

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
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Fuzzpilz

Could be done with IsMusicPlaying relatively easily, I'd say.

Pumaman

It's possible, though as Fuzz says it's quite easy with scripting ... would anyone else find this useful as a built-in command?

Pet Terry

I would find it useful for my game in production.
<SSH> heavy pettering
Screen 7

Snake

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
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Captain Mostly

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...

Pumaman


m0ds

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

SMF spam blocked by CleanTalk