Question

Playing MP3 Files Directly Via Web Pages

Asked by: NeilGrant

I 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2002-10-13 at 20:56:01ID20373425
Topics

Web Development Software

,

Macromedia Homesite

Participating Experts
4
Points
250
Comments
27

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. mp3 to wav?
    Can anyone teach me how to decode the mp3 back to the wav file? Please provide step by step instruction thanks.
  2. Mp3 play
    Does anyone knows how to play mp3 with Visual Basic, just with code. Not trough any other programs.
  3. Play Mp3 or Wav
    I've been looking for ages for a bit of javascript code to play an mp3 or wav file on my web site. Can anyone help please?
  4. mp3...
    Is it possible to play mp3 files from my visual basic application? Is there any mp3 components available? If there is, could you tell me where to find some. Thanks in advance!

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

by: T_SleeperPosted on 2002-10-14 at 01:24:15ID: 7332475

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


<html xmlns:t ="urn:schemas-microsoft-com:time" >

<head>
<title>test</title>
<style>
     .time { behavior: url(#default#time2) }
</style>

</head>

<body>
<?IMPORT namespace="t" implementation="#default#time2">

<button id=startMedia>Play</button>&nbsp;&nbsp;
<button id=stopMedia>Stop</button>
<t:audio begin="startMedia.Click" end="stopMedia.Click" src="sound.wav" mute="false" />

</body>

</html>


<=) woooot wooot

T_Sleeper

 

by: T_SleeperPosted on 2002-10-14 at 01:43:46ID: 7332499

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

 

by: turtlwaXPosted on 2002-10-16 at 08:02:49ID: 7337694

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

 

by: mastallamaPosted on 2002-10-16 at 10:48:40ID: 7338129

there's a cool Flash Sound API you can call too.  check this out: http://www.devx.com/webdev/articles/FlashsoundAPI/hp082201-1.asp

 

by: UnicornServicesdotnetPosted on 2002-10-23 at 11:58:17ID: 7361875

yes.. FLASH is the absolute best way to go.


check this out

http://norah.unicornservices.net/

and you'll see it in action

 

by: NeilGrantPosted on 2002-10-23 at 20:37:06ID: 7363767

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-com:time" >

<head>
     <title>test</title>
     <style>
     .time { behavior: url(#default#time2) }
     </style>
</head>

<body>

<?IMPORT namespace="t" implementation="#default#time2">
<button id="startMedia">Play</button> &nbsp; <button id="stopMedia">Stop</button>
<t:audio begin="startMedia.Click" end="stopMedia.Click" src="sound.wav" mute="false" />
</body>

</html>

 

by: UnicornServicesdotnetPosted on 2002-10-23 at 21:18:35ID: 7363854

Yes, but wouldn't this method be limited to I.E. users? where as flash is easier to code, and flash is available for netscape & i.e.?

 

by: T_SleeperPosted on 2002-10-24 at 00:48:15ID: 7364248

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" />

 

by: NeilGrantPosted on 2002-10-24 at 01:08:12ID: 7364282

To T Sleeper.  Thanks comments have been passed on to my friend

Neil

 

by: mastallamaPosted on 2002-10-24 at 12:38:15ID: 7366645

to Unicorn...

oooooooooooohhhhhhhh, Norah... :-)   That's a nice unofficial site you got there, nice flash.  The pictures go by real fast in the pics section though.

 ~ MastaLlama ~

 

by: UnicornServicesdotnetPosted on 2002-10-24 at 12:51:12ID: 7366693

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.

 

by: turtlwaXPosted on 2002-10-24 at 12:54:22ID: 7366713

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.thunderwolveshockey.com

(direct to ad: http://www.thunderwolveshockey.com/chuckAPuckAd.asp)

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/software/player_census/flashplayer/version_penetration.html)

hope this helps

 

by: mastallamaPosted on 2002-10-24 at 12:57:00ID: 7366726

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 ~

 

by: UnicornServicesdotnetPosted on 2002-10-24 at 13:13:01ID: 7366794

Oh.. scantilly clad is ok.. ;-) .. Give "angela" my phone #, will ya..

 

by: mastallamaPosted on 2002-10-24 at 13:40:18ID: 7366880

here's another example of flash with sound...

http://www3.quantumlynx.com/barontech/list/sayit.swf

 :-)

 ~ MastaLlama ~

 

by: T_SleeperPosted on 2002-10-25 at 07:10:05ID: 7369519

Neil,

as a test/help, i've made a page on the net

http://www.warantz.be/sound/test.htm

have a blast ;-)

 

by: UnicornServicesdotnetPosted on 2002-10-25 at 08:47:50ID: 7369882

Q.. T_sleeper.. where does this method work? Is it not only Windows based machines with IE?  Yes, your solution works, but on a limited scope..

 

by: turtlwaXPosted on 2002-10-25 at 09:21:01ID: 7370010

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

 

by: T_SleeperPosted on 2002-10-28 at 07:08:44ID: 7378635

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)

 

by: turtlwaXPosted on 2002-10-28 at 08:00:37ID: 7378890

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)

 

by: UnicornServicesdotnetPosted on 2002-10-28 at 08:28:41ID: 7379067

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

 

by: UnicornServicesdotnetPosted on 2002-10-28 at 08:30:57ID: 7379081

Still, T_Sleepers solution doesn't help for 'onclick' unless you make the button your creating also go to a url..


http://www.unicornservices.net/lowend/corner.htm


see my little play buttons there

and

http://norah.unicornservices.net/norahmusic.htm

see what happens on "hover" (mouseover)

 

by: UnicornServicesdotnetPosted on 2002-10-28 at 08:32:04ID: 7379088

Oh.. btw.. the reason I have the music as on mouseover, is because that makes it just a little bit harder to use these samples in such a way that they can violate copyright..

 

by: UnicornServicesdotnetPosted on 2002-10-28 at 13:50:30ID: 7380485

Oh.. btw.. the reason I have the music as on mouseover, is because that makes it just a little bit harder to use these samples in such a way that they can violate copyright..

 

by: mastallamaPosted on 2002-10-28 at 13:56:27ID: 7380505

thanks for the reassurance :-p

hey NeilGrant,

  so wassup with this Q?  are we done here?

 ~ MastaLlama ~

 

by: NeilGrantPosted on 2002-10-28 at 16:03:45ID: 7380932

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

 

by: mastallamaPosted on 2002-10-28 at 18:46:24ID: 7381315

well, we gave you plenty of examples and links for help if you decide to ever check out Flash's sound capabilities.

good luck!

btw...Unicorn couldn't HANDLE Angela...hee hee

 ~ MastaLlama ~

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...