By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,959 Members | 1,545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,959 IT Pros & Developers. It's quick & easy.

How to Play a series of .mid files as background

P: n/a
Hi,

I'm trying to write some javascript to set up a series of MIDI files as
background using <EMBED>. I can get it to work in general, but the main
problem I have is:

what coding can be used so that each subsequent selection only starts when
the previous selection has finished.

an additional problem will be:

how to clear the control panel from the display after the selection has
finished.

The coding I'm trying to use is something like this in the <BODY>:

<SCRIPT>
var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";

for (var counter = 0; counter < 3; counter++) {
// something in here to determine when the next piece can start, and to
clear the Console
var sounds = soundFile.split(",");soundFile = sounds[counter];
document.write('<embed src="'+soundFile+'" autostart="true"
controls="Console" width=144 height=60></embed>');
}
</SCRIPT>

<noscript><embed src="jsrgo1gm.mid" autostart="true" ></embed></noscript>
<noembed><bgsound src="jsrgo1gm.mid" ></noembed>

I would appreciate any help you can provide, and if there is an altogether
better way of doing this, I would appreciate hearing about that as well.

Thanks,

Jack


Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jack Sirulnikoff wrote:
Hi,

I'm trying to write some javascript to set up a series of MIDI files as
background using <EMBED>. I can get it to work in general, but the main
problem I have is:

what coding can be used so that each subsequent selection only starts when
the previous selection has finished.

an additional problem will be:

how to clear the control panel from the display after the selection has
finished.

The coding I'm trying to use is something like this in the <BODY>:

<SCRIPT>
var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";

for (var counter = 0; counter < 3; counter++) {
// something in here to determine when the next piece can start, and to
clear the Console
var sounds = soundFile.split(",");soundFile = sounds[counter];
document.write('<embed src="'+soundFile+'" autostart="true"
controls="Console" width=144 height=60></embed>');
}
</SCRIPT>

<noscript><embed src="jsrgo1gm.mid" autostart="true" ></embed></noscript>
<noembed><bgsound src="jsrgo1gm.mid" ></noembed>

I would appreciate any help you can provide, and if there is an altogether
better way of doing this, I would appreciate hearing about that as well.

Embed an .m3u file and let the default application handle it. An .m3u
file is nothing more than a "playlist" of files. The URLs in an .m3u
file *must* be absolute URLs.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 20 '05 #2

P: n/a
Thanks for your help. I set up an .m3u, and it worked perfectly from the
test directory on my hard drive. Since all my files are in one directory, it
worked both with just the filename, and using the absolute URL. However,
neither way worked when I tried to run it from my website. I suspect the
problem still has to do with that, but I'm not sure what the answer is.

Jack

"Randy Webb" <hi************@aol.com> wrote in message
news:R_********************@comcast.com...
Jack Sirulnikoff wrote:
Hi,

I'm trying to write some javascript to set up a series of MIDI files as
background using <EMBED>. I can get it to work in general, but the main
problem I have is:

what coding can be used so that each subsequent selection only starts when the previous selection has finished.

an additional problem will be:

how to clear the control panel from the display after the selection has
finished.

The coding I'm trying to use is something like this in the <BODY>:

<SCRIPT>
var soundFile = "jsrgo1gm.mid,jsrgo2gm.mid,jsrgo3gm.mid";

for (var counter = 0; counter < 3; counter++) {
// something in here to determine when the next piece can start, and to
clear the Console
var sounds = soundFile.split(",");soundFile = sounds[counter];
document.write('<embed src="'+soundFile+'" autostart="true"
controls="Console" width=144 height=60></embed>');
}
</SCRIPT>

<noscript><embed src="jsrgo1gm.mid" autostart="true"

</embed></noscript>
<noembed><bgsound src="jsrgo1gm.mid" ></noembed>

I would appreciate any help you can provide, and if there is an altogether better way of doing this, I would appreciate hearing about that as well.

Embed an .m3u file and let the default application handle it. An .m3u
file is nothing more than a "playlist" of files. The URLs in an .m3u
file *must* be absolute URLs.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.