Question about background sounds?

Hi all, is it possible to force my background sound to play as soon as my page starts to load? What happens is that it plays after the load is finished, and if the load time is slow die to a slow connection, it seems odd and misplaced? Any thoughts? THANKS!!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On Nov 18, 2007, at 6:35 AM, bailey wrote:

Hi all, is it possible to force my background sound to play as soon
as my page starts to load? What happens is that it plays after the
load is finished, and if the load time is slow die to a slow
connection, it seems odd and misplaced? Any thoughts? THANKS!!

Not really, unless your background sound is also a very very small
file. The way that Web pages load is completely nondeterministic.
Requests go out for each element of the page (images, scripts, audio
files, whatever) and as many of them as can be fetched at a time
start downloading. When those are done, the next batch are requested.
And each element can (and sometimes does) take a different path from
the server to your computer. You as the designer have little or no
control over this process, and it is different for each person who
visits your site.

If your background sound was a very small file, you could try loading
it using the jQuery javascript library. That library has a function
called document.ready which basically allows you to do things in
JavaScript at the very earliest moment that the entire page framework
is loaded, but often before any of the page is displayed in the
browser. But most audio files are quite a bit larger than the HTML
and other resources which coexist with them, so I don’t imagine that
this will work at all.

Another thing you could try would be to use Flash, and a streaming
format audio file, and set the audio to start playing the instant
that enough of it has downloaded to the page to make that possible. I
don’t know exactly how you do that – it’s a Flash thing – but I do
know that it’s possible to do.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options