the example above only let the music file hear one time, for indefinite listening, use this line instead
<t:audio repeatCount="indefinite" begin="0" end="stopMedia.Click" src="invitatie.mp3" mute="false" />
T_Sleeper
Main Topics
Browse All TopicsI am looking for the easiest way to play MP3 files on a web site based on a user clicking on an object on a browser page. I do not want any GUI interface to load. I just want them to hear the sound with no change to their GUI at all.
More Information:
Typically the sounds will be only 3 to 10 seconds in duration.
There cannot be much delay (except maybe the first time)
There should be no change to the users existing file associations.
Preferably no software should need to be loaded by the user. If any is required, it must be freely distributable.
Preferably there should be no or minimal configuration work to do by the user.
I am not overly proficient with web page design so simple solutions would be preferred.
If this can be done much more easily with WAV files then they would be considered.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Shot in the dark...but a real easy way to play an mp3 in a webPage...without changing the GUI would be to employ macromedia Flash.
www.macromedia.com for more info
there's a cool Flash Sound API you can call too. check this out: http://www.devx.com/webdev
yes.. FLASH is the absolute best way to go.
check this out
http://norah.unicornservic
and you'll see it in action
Message for T Sleeper.
Thanks for your reply. I am very interested in getting your solution to work and award you with the points. However, I am not very web proficient and so I have asked a friend to help me.
He has tried to get the code to work. He is using IE 6.0 and has not been able to get it to work.
I have listed the source below that he has used. Are you able to identify the problem? We appreciated the help.
Neil Grant
------ code ------
<html xmlns:t ="urn:schemas-microsoft-co
<head>
<title>test</title>
<style>
.time { behavior: url(#default#time2) }
</style>
</head>
<body>
<?IMPORT namespace="t" implementation="#default#t
<button id="startMedia">Play</butt
<t:audio begin="startMedia.Click" end="stopMedia.Click" src="sound.wav" mute="false" />
</body>
</html>
euhm code looks fine
only thing that could b wrong is the place of the .wav file
if you have the html in the root of your web and you are using this code, then place the sound.wav also into the root.
if you want a structured web and have made your web like this:
wwwroot/testfile.html
wwwroot/sounds/sound.wav
then your code should b alterd a bit offcourse
this line should be changed
<t:audio begin="startMedia.Click" end="stopMedia.Click" src="sounds/sound.wav" mute="false" />
mastallama.. actually, that was intentional.. it was meant to be almost a "subliminal message" teaser.. i have it going as fast as your bandwidth will allow.. (and flash'es bog down limitation"
thanks for the kudos.. I'm getting bluenote records to make me their OFFICIAL fansite.. (but not official artist site)
I apologize for the low quality, short mp3 playback, but I dont want to violate copyright
do you like "hover over the listen" feature?
no having to press play, or stop, yada yada.
I dunno....but i must stick to my guns on this and say that flash is the easiest and best way to pull this off. Granted there is a plugin involved....but you can compile as far back as flash4.
a good example of this in action is at the advertisement that pops up on the homepage of
http://www.thunderwolvesho
(direct to ad: http://www.thunderwolvesho
The ad has a 30 second radio announcement attached to it. The 444kb .mp3 file compressed to just under 60kb .swf file without losing too much quality. To me...that is efficient. Not to mention that it is said that the flash4 player is on 96%+ of the world's web browsers (http://www.macromedia.com
hope this helps
well, the hover was cool, but if i have to do something else at the same time then i can't...(ex: type an email, view her pictures *whistle!*) Check out http://www.alexisoo.com/ and don't worry, it's just a modeling site, no porn. Once you enter the site there's a cool flash music player in the top right corner. it has 3 tracks (all 3 are just loops) and it has play, pause, stop, next, prev...also, click on the headphones there too.
that's sooo cool!
I'm gonna have to look at your Norah site at home w/ the dial-up connection...hee hee...stupid high speed internet...
~ MastaLlama ~
here's another example of flash with sound...
http://www3.quantumlynx.co
:-)
~ MastaLlama ~
Neil,
as a test/help, i've made a page on the net
http://www.warantz.be/soun
have a blast ;-)
Ya...i couldn't get that code to work in Netscape 4.x through to 7....so it is arguably not a very good solution. On the other hand...the flash solution is cross browser/OS compliant, but does require the user to permit javascript and have a plugin.
not too sure why the flash solution is being ignored...but best of luck to you all
unic... at my first post is stated this:
-----
this is for wav, mid, mp3, ...
only prob with this is that it only works for browsers ie 5.5 or higher.
don't know how it works in netscape
-----
and since Neil said:
------
Thanks for your reply. I am very interested in getting your solution to work
------
i guess my solution works fine enough 4 him and yea i know it only works in IE so as i warned him
but if it solves the prob, then why make more effort, mayb he doesn't know flash or mayb he doesn't have Flash 5, 6, ...
also mayb there's a code solution 4 this in Netscape, altho i wouldn't know one and using code instead of plugs is always my favorite (clients not needing to use plugins, wich they mayb don't like)
T-Sleeper....i would agree with you on many of your fronts. However...the flash player has been a widely accepted plugin for many years now. In fact IE and Netscape have been bundling the player with their products since 4.x versions. Further to this Microsoft bundles the standAlone player with their OS.
Finally the Flash player is reported to be be on 97% of the world's web browsers. (see my previous post)
Additionally, coding flash is far simpler than coding php, jscript, etc.. if the contention is that FlashMX is too expensive, then use SWISH,.. $49.95, and even has a 14 day free trial.. plenty of time to make those few little .swfs (completely compatible with flashplayer) that have embedded MP3s
(swish method.. quoting off the top of my head)
"File" "new" "movie" make movie stage something small like 1x1
"add | action | play sound | song.mp3"
check or uncheck "loop movie" option
set frame rate to say.. 10 FPS
if you want the sound to play for 20 seconds, set a "STOP movie" at frame 200. If you want it to loop, then dont do this.
"File | Export | SWF"
done
Still, T_Sleepers solution doesn't help for 'onclick' unless you make the button your creating also go to a url..
http://www.unicornservices
see my little play buttons there
and
http://norah.unicornservic
see what happens on "hover" (mouseover)
Thanks very much for your help on this matter. You not only provided code that worked as I wished, but even a sample to prove it.
(My friend still has some problems getting it to work.)
Of equal value to me was the lively discussion this question generated.
Did UnicornServicesdotnet hook up with angela, by the way?
All the discussion has forced me to rethink my requirements and I will now pursue using either Flash or SWISH and see how I go.
Thanks again, enjoy the points
Business Accounts
Answer for Membership
by: T_SleeperPosted on 2002-10-14 at 01:24:15ID: 7332475
this is for wav, mid, mp3, ...
m:time" >
ime2">
> &nb sp;
only prob with this is that it only works for browsers ie 5.5 or higher.
don't know how it works in netscape
<html xmlns:t ="urn:schemas-microsoft-co
<head>
<title>test</title>
<style>
.time { behavior: url(#default#time2) }
</style>
</head>
<body>
<?IMPORT namespace="t" implementation="#default#t
<button id=startMedia>Play</button
<button id=stopMedia>Stop</button>
<t:audio begin="startMedia.Click" end="stopMedia.Click" src="sound.wav" mute="false" />
</body>
</html>
<=) woooot wooot
T_Sleeper