Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #8670 > unrolled thread

preload audio

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2011-11-28 17:45 +1100
Last post2011-11-30 10:50 +0100
Articles 7 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  preload audio Andrew Poulos <ap_prog@hotmail.com> - 2011-11-28 17:45 +1100
    Re: preload audio SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2011-11-28 13:47 +0100
      Re: preload audio Stefan Weiss <krewecherl@gmail.com> - 2011-11-28 23:44 +0100
        Re: preload audio SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2011-11-29 03:52 +0100
          Re: preload audio Andrew Poulos <ap_prog@hotmail.com> - 2011-11-29 17:38 +1100
            Re: preload audio SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2011-11-29 12:17 +0100
              Re: preload audio SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2011-11-30 10:50 +0100

#8670 — preload audio

FromAndrew Poulos <ap_prog@hotmail.com>
Date2011-11-28 17:45 +1100
Subjectpreload audio
Message-ID<lbedneSh98WYs07TnZ2dnUVZ_tydnZ2d@westnet.com.au>
Does doing something like

var a = new Image()
a.src = "http://www.blah.com/test.mp3";

download/preload the audio? I want to dynamically add an audio OBJECT to 
the page and I'd like it, if possible, to start playing as soon as its 
added (there being some time between when the page is viewed and when 
the object is added).

Andrew Poulos

[toc] | [next] | [standalone]


#8672

FromSAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid>
Date2011-11-28 13:47 +0100
Message-ID<4ed382f6$0$2497$ba4acef3@reader.news.orange.fr>
In reply to#8670
Le 28/11/11 07:45, Andrew Poulos a écrit :
> Does doing something like
>
> var a = new Image()
> a.src = "http://www.blah.com/test.mp3";
>
> download/preload the audio?

No, that does not preload the file (even if it would be an image)


> I want to dynamically add an audio OBJECT to
> the page and I'd like it, if possible, to start playing as soon as its
> added (there being some time between when the page is viewed and when
> the object is added).

I hope that the zick is wanted by the visitor ?

> Andrew Poulos

I think it is very difficult
all depends of what plugin is installed on the visitor's computer
(and of course depends of the navigator)

Maybe you can try with an application in Flash ?
Some of them have a jukebox (a playlist)
Example:
<http://www.alsacreations.fr/dewplayer> (in french ...)
<http://www.alsacreations.fr/dewplayer-en.html>(en anglais)

-- 
Stéphane Moriaux avec/with iMac-intel

[toc] | [prev] | [next] | [standalone]


#8690

FromStefan Weiss <krewecherl@gmail.com>
Date2011-11-28 23:44 +0100
Message-ID<AqednQV6-_BGk0nTnZ2dnUVZ8v6dnZ2d@giganews.com>
In reply to#8672
On 2011-11-28 13:47, SAM wrote:
> Le 28/11/11 07:45, Andrew Poulos a écrit :
>> Does doing something like
>>
>> var a = new Image()
>> a.src = "http://www.blah.com/test.mp3";
>>
>> download/preload the audio?
> 
> No, that does not preload the file (even if it would be an image)

It does, actually. This is the most common way to preload images. The
MP3 file will get downloaded, too, and under normal circumstances it
should also remain cached on the client. Whether that helps with audio
objects, I don't know. You could just try it out, while keeping an eye
on the server access log. I wouldn't be surprised if it turns out to
work as intended. If you end up using this technique for audio files,
make sure to test it in more than one browser.


-- 
stefan

[toc] | [prev] | [next] | [standalone]


#8693

FromSAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid>
Date2011-11-29 03:52 +0100
Message-ID<4ed44901$0$2511$ba4acef3@reader.news.orange.fr>
In reply to#8690
Le 28/11/11 23:44, Stefan Weiss a écrit :
> On 2011-11-28 13:47, SAM wrote:
>> Le 28/11/11 07:45, Andrew Poulos a écrit :
>>> Does doing something like
>>>
>>> var a = new Image()
>>> a.src = "http://www.blah.com/test.mp3";

> MP3 file will get downloaded, too, and under normal circumstances it
> should also remain cached on the client. Whether that helps with audio
> objects, I don't know. You could just try it out, while keeping an eye
> on the server access log. I wouldn't be surprised if it turns out to
> work as intended. If you end up using this technique for audio files,
> make sure to test it in more than one browser.

Except when HTML.5 will run everywhere, there is no way to be sure to 
play sound and less again to play sound charged on the fly.

I used old technique to play sound (in midi files) that worked on 
Netscape, then on "my" Firefox but now that does no more work because of 
plugin QuickTime or maybe errors when uploading the files on the sever 
(sometimes it works locally).

To be "clean" I really think we must use Flash to play sounds.

-- 
Stéphane Moriaux avec/with iMac-intel

[toc] | [prev] | [next] | [standalone]


#8695

FromAndrew Poulos <ap_prog@hotmail.com>
Date2011-11-29 17:38 +1100
Message-ID<-Z6dnfbSddRF4EnTnZ2dnUVZ_oydnZ2d@westnet.com.au>
In reply to#8693
On 29/11/2011 1:52 PM, SAM wrote:
> Le 28/11/11 23:44, Stefan Weiss a écrit :
>> On 2011-11-28 13:47, SAM wrote:
>>> Le 28/11/11 07:45, Andrew Poulos a écrit :
>>>> Does doing something like
>>>>
>>>> var a = new Image()
>>>> a.src = "http://www.blah.com/test.mp3";
>
>> MP3 file will get downloaded, too, and under normal circumstances it
>> should also remain cached on the client. Whether that helps with audio
>> objects, I don't know. You could just try it out, while keeping an eye
>> on the server access log. I wouldn't be surprised if it turns out to
>> work as intended. If you end up using this technique for audio files,
>> make sure to test it in more than one browser.
>
> Except when HTML.5 will run everywhere, there is no way to be sure to
> play sound and less again to play sound charged on the fly.
>
> I used old technique to play sound (in midi files) that worked on
> Netscape, then on "my" Firefox but now that does no more work because of
> plugin QuickTime or maybe errors when uploading the files on the sever
> (sometimes it works locally).
>
> To be "clean" I really think we must use Flash to play sounds.

Alas that rules out all iOS devices.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#8699

FromSAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid>
Date2011-11-29 12:17 +0100
Message-ID<4ed4bf5c$0$2526$ba4acef3@reader.news.orange.fr>
In reply to#8695
Le 29/11/11 07:38, Andrew Poulos a écrit :
> On 29/11/2011 1:52 PM, SAM wrote:
>>
>> To be "clean" I really think we must use Flash to play sounds.
>
> Alas that rules out all iOS devices.

Ooops ! Not false.

Is that a good idea to tell them to "pre"load all that sounds ?
Not too heavy to get, charge, load ?
(3G or WI-FI b/g)


Haven't they their own CSS (style-sheet tag link) ?

to show them the div filled up with audio(*) tags
and to hide the Flash-sounds-player


(*) Hope that their versions of Safari know that tag ...

-- 
Stéphane Moriaux avec/with iMac-intel

[toc] | [prev] | [next] | [standalone]


#8720

FromSAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid>
Date2011-11-30 10:50 +0100
Message-ID<4ed5fc5f$0$2502$ba4acef3@reader.news.orange.fr>
In reply to#8699
Le 29/11/11 12:17, SAM a écrit :
> Le 29/11/11 07:38, Andrew Poulos a écrit :
>> On 29/11/2011 1:52 PM, SAM wrote:
>>
>> Alas that rules out all iOS devices.
>
> Ooops ! Not false.

Some reading :
A rock-solid default for HTML5 awesome:
<http://html5boilerplate.com/>
Safari audio and video:
<http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/AudioandVideoTagBasics/AudioandVideoTagBasics.html>

-- 
Stéphane Moriaux avec/with iMac-intel

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web