ID:169324
 
Is there anyway to check if no song is playing? I know you can set songs to wait for the others to finish, but is there some kind of built-in list I could use? I need this because the songs that are playing are going to be supplied by players, and will vary in length. Thanks in advance.
I don't believe so, no. Sorry. With .wav files I think you can queue them up (check out the sound() proc's options), but I don't think .mid files can be queued. I might be wrong though, and 3.5's fmod integration may have changed subtleties like this.

BYOND will hopefully be getting better sound support in a version or two, so you may just have to wait it out and see if this feature gets added.
In response to Crispy (#1)
I'm 99.9% sure there is no way to check this; because files are simply loaded and sent to the players. The players are playing the sound/midi/etc, not Dream Daemon. Depending on the lag, one player may hear part of the file 10 seconds before someone else =P You can use the sleep() proc if you're using a verb that allows players to queue songs/sounds and have them manually input the duration in seconds times 10, but I don't think that files have duration vars yet :(
In response to Cowdude (#2)
Maybe you could do something with java?
In response to Flame Sage (#3)
Perhaps there is some size-by-time aglorithm with midi's? I.E, for every kilobyte, you get a second of song time?
In response to CaptFalcon33035 (#4)
I really don't think that's how midis work... the sole advantage of midis over an actual recording is that by recording the arrangement of notes rather than the actual sound of the song playing, it saves space. Any given moment of playtime may be silent, or have a variable number of notes playing.
In response to CaptFalcon33035 (#4)
Nah. A MIDI file just saves each individual note that is played; its instrument, pitch, length, whatever. Notes are of variable length and several notes can be played at once. Not to mention that there's a tempo setting as well.

Nice thinking outside the square, though, even if it didn't work. =)

I suppose what you could do is load an external program that checks the length of the MIDI file and reports back to the game. But then the host will get spammed with "do you want to allow this file to run?" dialogs, and will probably reject them all, making the system unworkable.

Using the browser could work, though. Flame Sage suggested Java, which I suppose could work, though I wouldn't recommend it; loading a Java applet in the middle of a game will LAAAAAAAAAAAAG to Neptune and back. You could use Flash, though; I believe it has MIDI capabilities, and I know various people (Elation and Scoobert) have made BYOND and Flash communicate successfully.

You will almost certainly encounter compatibility issues (e.g. people don't have the Flash plugin) if you try to run Flash applets on everyone's Dream Seekers. Which is not to say you couldn't do that, of course, but be prepared to handle some users complaining that it doesn't work. You might be able to use Flash server-side to determine the length of the song and wait for that long before starting the next song, but you'd need a local client logged in so that you could run the Flash plugin on their browser.

Any way you try to do it is going to be hackish. =P