473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Preload Audio? - Novice Needs Help

Hi - My js knowledge is pretty much cut-'n-paste, and I'd appreciate a
little guidance.I have a simple splash webpage that includes an embedded
..wav file of about 60kb. Currently, some dial-up users have pretty much
completed viewing the page before the .wav file starts playing. I'd like to
delay opening the page until the .wav file has loaded, so that the music
starts about when the viewer first sees the page. I know there's a risk of
the delay time turning off some pholks, but I'd like to try it. Is it
possible? Can someone get me started with the code? Thanks much.
~OC~
Jul 20 '05 #1
2 5025
OysterCracker wrote:
Hi - My js knowledge is pretty much cut-'n-paste, and I'd appreciate a
little guidance.I have a simple splash webpage that includes an embedded
..wav file of about 60kb. Currently, some dial-up users have pretty much
completed viewing the page before the .wav file starts playing. I'd like to
delay opening the page until the .wav file has loaded, so that the music
starts about when the viewer first sees the page. I know there's a risk of
the delay time turning off some pholks, but I'd like to try it. Is it
possible? Can someone get me started with the code? Thanks much.


Put up a blank page, with:
<body onload="document.location.href="realPage.html"'>
<code here to play the wav>

When the .wav gets loaded, it will set the page to the actual page.
Since the .wav *should* then be in the cache, it will play.

What you have done though is now pissed off a lot of people that have
had to sit and look at a blank page while your unwanted sound is loaded.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2

"OysterCracker" <oc@sc.rr.nononono.com> wrote in message
news:Gd*********************@twister.southeast.rr. com...
completed viewing the page before the .wav file starts playing. I'd like to delay opening the page until the .wav file has loaded, so that the music

I was intrigued by your question, and went searching. Found this (at
http://www.webreference.com/javascri...16/source.html) and created a
working example from it. I have no idea how this works in anything other
than ie. The key is document.*mysound*.play() - *mysound* refers to the name
given in the embed tag, where the source file is also identified.

<html>
<head>
<title></title>

<script>

function playWav() {

document.mysound.play();
}
</script>


<body onload="playWav();">

<EMBED SRC = "SOUND1.WAV"
HIDDEN = TRUE
CONTROLS = console
VOLUME = 100
LOOP = FALSE
AUTOSTART = FALSE
NAME = "mysound"
MASTERSOUND>

the rest of the webpage.....
</body>
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MALdito | last post by:
hi everybody let me say right from the start .. I´m not a coder ... "just" a designer! that said .. here is my question: I´m using dreamweaver´s built in preloader for a menu. it looks like...
3
by: Bruce | last post by:
I'm looking for an example of using a single preloaded image, where a few images are loaded in a document.write. Can anyone help with a simple example (as I'm still a novice in javascript). ...
2
by: Albert Spencil | last post by:
I have tried several preload scripts found here; plus, some of my own. The only thing that works is the unsophisticated loading of those tiny images. The download consist of 100+ images amounting...
1
by: Peter Fastré | last post by:
Hello The javascript preload function I always used, is causing problems with the latest version of gecko-browsers. Never had any problems with it though. Maybe there's something wrong? ...
1
by: Andrew Poulos | last post by:
I'm dynamically building a standards compliant HTML 4 Strict page depending on how the selections a user makes. If the user chooses audio (a non-streaming format) a custom button appears to allow...
7
by: Andrew Poulos | last post by:
I've asked this question in a javascript group and I'm asking it here in case there's a HTML solution. I'm using HTML 4 Strict and I'm wondering if there's a way to preload a sound? Any solution...
1
by: Ron Provost | last post by:
Hello, I'm developing a piece of software to assist illiteraate adults to learn to read. I'm trying to figure out how, if possible, to make audio playback asynchrnous but still controllable. ...
3
by: gilad | last post by:
This is to announce the beta 2 release of Aumplib. After garnering comments from this newsgroup, I have modified the code to use a more standard style convention. Aumplib is a C# namespace which...
6
by: Quentin | last post by:
Hi, I want to save an audio stream into a circular file so that I only keep say the last hour's audio. Can anybody help? Cheers, Quentin
2
by: Davd S. Zuza | last post by:
Hi all, I am a novice developer and I was wondering if it is possible to record and saved an internet audio stream. Remember I am a novice developer. Thanks for any help
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.