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

playing short sound files without controls on the page

P: n/a
Hi,

Is there a cross-browser way to play short (< 25K) sound files without
spawning new windows or embedding any visual controls on the page? I
would like to click a button and hear my short sound.

Thanks for your help, - Dave

ps - Searching Google turned up stuff for Netsacpe and IE 3, but I was
hoping more for IE 7 and Firefox.

Feb 2 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Feb 2, 8:35 am, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
Hi,

Is there a cross-browser way to play short (< 25K) sound files without
spawning new windows or embedding any visual controls on the page? I
would like to click a button and hear my short sound.

Thanks for your help, - Dave

ps - Searching Google turned up stuff for Netsacpe and IE 3, but I was
hoping more for IE 7 and Firefox.
Hey Dave,

The easiest way is to attach an 'embed' element and then change the
src attribute. This willl load the file at that time and play it when
it is loaded.

I also wrote a small sound class for a particular need I had. I posted
it here http://adambragg.blogspot.com/

getburl

Feb 2 '07 #2

P: n/a
On Feb 2, 11:18 am, "getburl" <adampbr...@gmail.comwrote:
On Feb 2, 8:35 am, "laredotorn...@zipmail.com"

<laredotorn...@zipmail.comwrote:
Hi,
Is there a cross-browser way to play short (< 25K) sound files without
spawning new windows or embedding any visual controls on the page? I
would like to click a button and hear my short sound.
Thanks for your help, - Dave
ps - Searching Google turned up stuff for Netsacpe and IE 3, but I was
hoping more for IE 7 and Firefox.

Hey Dave,

The easiest way is to attach an 'embed' element and then change the
src attribute. This willl load the file at that time and play it when
it is loaded.

I also wrote a small sound class for a particular need I had. I posted
it herehttp://adambragg.blogspot.com/

getburl
Thanks for posting this. This is a very cleanly written class. I do
have one question. is calling the "draw" function the equivalent of
calling play? So, if someone clicked on a button labeled "Play",
would the right JS be

var s = new Sound();
s.initialize('/path/to/my/sound', null, 'arbitraryId');
s.draw();

?

Thanks again, - Dave

Feb 2 '07 #3

P: n/a
On Feb 2, 1:39 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
On Feb 2, 11:18 am, "getburl" <adampbr...@gmail.comwrote:


On Feb 2, 8:35 am, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
Hi,
Is there a cross-browser way to play short (< 25K) sound files without
spawning new windows or embedding any visual controls on the page? I
would like to click a button and hear my short sound.
Thanks for your help, - Dave
ps - Searching Google turned up stuff for Netsacpe and IE 3, but I was
hoping more for IE 7 and Firefox.
Hey Dave,
The easiest way is to attach an 'embed' element and then change the
src attribute. This willl load the file at that time and play it when
it is loaded.
I also wrote a small sound class for a particular need I had. I posted
it herehttp://adambragg.blogspot.com/
getburl

Thanks for posting this. This is a very cleanly written class. I do
have one question. is calling the "draw" function the equivalent of
calling play? So, if someone clicked on a button labeled "Play",
would the right JS be

var s = new Sound();
s.initialize('/path/to/my/sound', null, 'arbitraryId');
s.draw();

?

Thanks again, - Dave- Hide quoted text -

- Show quoted text -
Sort of. I called it draw because that is more literal. Render would
be even more literal because the DOM element is being inserted into
the DOM of the page. So, the element is being drawn or rendered on the
page. Then there is load time until the sound plays. So, you could
rename it to play if that is more intuitive. Very good point. I may
have to change that.

Feb 2 '07 #4

P: n/a
On Feb 2, 1:39 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
On Feb 2, 11:18 am, "getburl" <adampbr...@gmail.comwrote:


On Feb 2, 8:35 am, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
Hi,
Is there a cross-browser way to play short (< 25K) sound files without
spawning new windows or embedding any visual controls on the page? I
would like to click a button and hear my short sound.
Thanks for your help, - Dave
ps - Searching Google turned up stuff for Netsacpe and IE 3, but I was
hoping more for IE 7 and Firefox.
Hey Dave,
The easiest way is to attach an 'embed' element and then change the
src attribute. This willl load the file at that time and play it when
it is loaded.
I also wrote a small sound class for a particular need I had. I posted
it herehttp://adambragg.blogspot.com/
getburl

Thanks for posting this. This is a very cleanly written class. I do
have one question. is calling the "draw" function the equivalent of
calling play? So, if someone clicked on a button labeled "Play",
would the right JS be

var s = new Sound();
s.initialize('/path/to/my/sound', null, 'arbitraryId');
s.draw();

?

Thanks again, - Dave- Hide quoted text -

- Show quoted text -
I did not read your code quite as well as I should have. The correct
instantiation would be:

var s = new Sound('/path/to/my/sound', null, 'arbitraryId'); //
initialization is implicit when the object is instantiated
s.draw();

Feb 2 '07 #5

P: n/a
On Feb 2, 5:24 pm, "getburl" <adampbr...@gmail.comwrote:
On Feb 2, 1:39 pm, "laredotorn...@zipmail.com"

<laredotorn...@zipmail.comwrote:
On Feb 2, 11:18 am, "getburl" <adampbr...@gmail.comwrote:
On Feb 2, 8:35 am, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
Hi,
Is there a cross-browser way to play short (< 25K) sound files without
spawning new windows or embedding any visual controls on the page? I
would like to click a button and hear my short sound.
Thanks for your help, - Dave
ps - Searching Google turned up stuff for Netsacpe and IE 3, but I was
hoping more for IE 7 and Firefox.
Hey Dave,
The easiest way is to attach an 'embed' element and then change the
src attribute. This willl load the file at that time and play it when
it is loaded.
I also wrote a small sound class for a particular need I had. I posted
it herehttp://adambragg.blogspot.com/
getburl
Thanks for posting this. This is a very cleanly written class. I do
have one question. is calling the "draw" function the equivalent of
calling play? So, if someone clicked on a button labeled "Play",
would the right JS be
var s = new Sound();
s.initialize('/path/to/my/sound', null, 'arbitraryId');
s.draw();
?
Thanks again, - Dave- Hide quoted text -
- Show quoted text -

I did not read your code quite as well as I should have. The correct
instantiation would be:

var s = new Sound('/path/to/my/sound', null, 'arbitraryId'); //
initialization is implicit when the object is instantiated
s.draw();
Thanks. Just one more thing. When I load this script in the latest
version of Firefox on the PC, I'm getting a "Class is not defined"
error, supposedly referring to the line

var Sound = Class.create();

Was there something else I was supposed to include in addition to the
lines posted on your blog?

- Dave

Feb 2 '07 #6

P: n/a
On Feb 2, 3:48 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
On Feb 2, 5:24 pm, "getburl" <adampbr...@gmail.comwrote:


On Feb 2, 1:39 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
On Feb 2, 11:18 am, "getburl" <adampbr...@gmail.comwrote:
On Feb 2, 8:35 am, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
Hi,
Is there a cross-browser way to play short (< 25K) sound files without
spawning new windows or embedding any visual controls on the page? I
would like to click a button and hear my short sound.
Thanks for your help, - Dave
ps - Searching Google turned up stuff for Netsacpe and IE 3, but I was
hoping more for IE 7 and Firefox.
Hey Dave,
The easiest way is to attach an 'embed' element and then change the
src attribute. This willl load the file at that time and play it when
it is loaded.
I also wrote a small sound class for a particular need I had. I posted
it herehttp://adambragg.blogspot.com/
getburl
Thanks for posting this. This is a very cleanly written class. I do
have one question. is calling the "draw" function the equivalent of
calling play? So, if someone clicked on a button labeled "Play",
would the right JS be
var s = new Sound();
s.initialize('/path/to/my/sound', null, 'arbitraryId');
s.draw();
?
Thanks again, - Dave- Hide quoted text -
- Show quoted text -
I did not read your code quite as well as I should have. The correct
instantiation would be:
var s = new Sound('/path/to/my/sound', null, 'arbitraryId'); //
initialization is implicit when the object is instantiated
s.draw();

Thanks. Just one more thing. When I load this script in the latest
version of Firefox on the PC, I'm getting a "Class is not defined"
error, supposedly referring to the line

var Sound = Class.create();

Was there something else I was supposed to include in addition to the
lines posted on your blog?

- Dave- Hide quoted text -

- Show quoted text -
Hey Dave,

Yes, the class is based on the Prototype Framework found at http://
prototypejs.org/
The Sound class I wrote could be ported to a standalone class. I wrote
it based on Prototype out of my own specific need.

getburl

Feb 3 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.