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

Inserting MP3 into Valid HTML

P: n/a
I'm looking for a simple way to insert an MP3 file in the body of an
HTML page. The code below works, but it doesn't validate due to the
embed tag. Is there a way to rewrite the code so that it will validate
as either valid HTML, or better yet, XHTML?
<script>
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
</script>

<embed src="MY_SOUND.mp3" autostart="False" width="0" height="0"
id="sound1"
enablejavascript="true">

<form>
<input type="button" value="Play Sound" onClick="EvalSound('sound1')">
</form>
Sep 25 '08 #1
Share this Question
Share on Google+
8 Replies


P: n/a
In article
<4f**********************************@25g2000prz.g ooglegroups.com>,
Fleemo <fl******@comcast.netwrote:
I'm looking for a simple way to insert an MP3 file in the body of an
HTML page. The code below works, but it doesn't validate due to the
embed tag. Is there a way to rewrite the code so that it will validate
as either valid HTML, or better yet, XHTML?
<script>
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
</script>

<embed src="MY_SOUND.mp3" autostart="False" width="0" height="0"
id="sound1"
enablejavascript="true">

<form>
<input type="button" value="Play Sound" onClick="EvalSound('sound1')">
</form>
Consider

<a href="thisSound.mp3">This sound</a>

It is liberating for you because it is so simple. It is great for users
because they or their browsers can then do what they want with it when
they want.

--
dorayme
Sep 25 '08 #2

P: n/a
On Sep 24, 8:46*pm, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<4f71e9d1-0028-46d3-9ce5-ce157290f...@25g2000prz.googlegroups.com>,

*Fleemo <fleem...@comcast.netwrote:
I'm looking for a simple way to insert an MP3 file in the body of an
HTML page. The code below works, but it doesn't validate due to the
embed tag. Is there a way to rewrite the code so that it will validate
as either valid HTML, or better yet, XHTML?
<script>
function EvalSound(soundobj) {
* var thissound=document.getElementById(soundobj);
* thissound.Play();
}
</script>
<embed src="MY_SOUND.mp3" autostart="False" width="0" height="0"
id="sound1"
enablejavascript="true">
<form>
<input type="button" value="Play Sound" onClick="EvalSound('sound1')">
</form>

Consider

* *<a href="thisSound.mp3">This sound</a>

It is liberating for you because it is so simple. It is great for users
because they or their browsers can then do what they want with it when
they want.
Amen brother. People who build pages with background music will be
first up against the wall when the revolution comes.
Sep 25 '08 #3

P: n/a
In article
<cc**********************************@f36g2000hsa. googlegroups.com>,
zw*******@gmail.com wrote:
On Sep 24, 8:46*pm, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<4f71e9d1-0028-46d3-9ce5-ce157290f...@25g2000prz.googlegroups.com>,
Consider

* *<a href="thisSound.mp3">This sound</a>

It is liberating for you because it is so simple. It is great for users
because they or their browsers can then do what they want with it when
they want.

Amen brother. People who build pages with background music will be
first up against the wall when the revolution comes.
The sheer crying shame of it all, comrade, is that this will tend to
wipe out all those who do not own the means of production. It is the
factory workers desperately trying to be heard above the clatter of the
machinery that tend to do most of the embedding. Their leaders also
might wish to make unwelcome noise in the big houses. I have seen these
leaders meet and plan, and I have seen their motto:

autostart="true"/autoloud:"veryloud"

--
dorayme
Sep 25 '08 #4

P: n/a
>Consider
<a href="thisSound.mp3">This sound</a<

Thanks for the response, but the audio needs to be embedded on the
same page, it can't pop open another browser window.

Sep 25 '08 #5

P: n/a
In article
<ca**********************************@x16g2000prn. googlegroups.com>,
Fleemo <fl******@comcast.netwrote:
Consider
<a href="thisSound.mp3">This sound</a<

Thanks for the response, but the audio needs to be embedded on the
same page, it can't pop open another browser window.
What has "Consider <a href="thisSound.mp3">This sound</a>" got to do
with "... it can't pop open another browser window".

Please quote who you are replying to. Many people here are not using
Google Groups.

--
dorayme
Sep 26 '08 #6

P: n/a
What has "Consider <a href="thisSound.mp3">This sound</a>" got to
do
with "... it can't pop open another browser window".

Please quote who you are replying to. Many people here are not using
Google Groups.
Dorayme, I'm quoting you. As far as I can tell, using the simple
method you suggested results in the user being taken to a different
page. I need the audio to play on the same page as the trigger, be it
a link or a button.
Sep 26 '08 #7

P: n/a
I'm looking for a simple way to insert an MP3 file in the body of an
HTML page. The code below works, but it doesn't validate due to the
embed tag. Is there a way to rewrite the code so that it will validate
as either valid HTML, or better yet, XHTML?
You can insert mp3 very easy without programming knowledge. Look at:
http://longurl.net/InsertMP3.aspx

Sep 29 '08 #8

P: n/a
More informations

http://philippe.chappuis.googlepages...ying-mp3-files

I hope this will give you some ideas
---

http://philippe.chappuis.googlepages...e-page-creator

---
Sep 29 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.