PDA

View Full Version : Pre-loading music



damnitsux2bu
02-20-2007, 10:55 PM
I hope I've posted this question in the correct forum group. I was wondering if there was a way to pre-load .mp3 files so that when the page they were on was accessed, they would play right away, as opposed to taking forever to load. They're not on the home page of the site. Any suggestions would be appreciated.

Thanks.

Peter

jscheuer1
02-21-2007, 05:10 AM
I found this worked:

<embed src="some.mp3" loop="false" autostart="false" hidden="true">

I put it in the head of the page but, I think it technically belongs in the body. However, preloading a sound file (aside from there being no javascript sound object that I am aware of) is very much like preloading an image file. It won't make it download any faster and will only be successful in speeding up loading if the file download (caching) is complete before the file is needed. If the file has only partially cached, loading will start over when it is needed. So, it is a good idea (just like with images) to compress the file as much as possible so as to reduce the amount of time required for it to become cached.

damnitsux2bu
02-22-2007, 01:46 AM
I've tried that and it didn't really seem to help much. Is there some way of maybe streaming it that would make it faster? Anything in HTML that would help? I'm at a loss on this one.

jscheuer1
02-22-2007, 05:00 AM
Have a look here then:

http://www.developingwebs.net/html/mp3.php