Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Set Up a Page to Play WAV or MP3 Files? 1

Status
Not open for further replies.

xyzuser

Technical User
Aug 13, 2008
96
0
0
US
I know this is a very basic question but I have not done this before. I want to have a JPG with an HREF to another URL that will play a WAV or MP3 file when the JPG is 'clicked". (Doesn't force visitor to have to listen to music. Allows visitor to decide if music is wanted).

I know how to set up the JPG/HREF but what HTML do I need on the page that will play the WAV or MP3 file? And does this page URL have ".wav" or ".mp3" instead of ".html"?

I would appreciate if someone would be kind enough to tell me how to do this, or would point me to where this is documented that I can read how to do this.

Thank you
 
There is no mechanism in HTML to play mp3 or wav files. You can either create a link to such a file or embed the file in some sort of plug-in to play it. The first will result in the client's browser figuring out what to do with the file: if the browser is not set up to play the file, it will offer to download it. Otherwise, it will load the appropriate plug-in and play the file. The other option is to call a plug-in in the first place, a plug-in that you expect most users to have. One of such plug-ins would be flash, which is capable of playing both mp3s and wavs and is found in most modern systems.

I would suggest you download one of the freely available flash players and embed that on a page. Then your users can push play or pause depending on whether they want sound or not.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thank you, Vragabond. I put in:

Code:
<A href="/Music/ThisSong.wav"><IMG src="images/MyImage.gif" border="0" alt="Click to hear this song"></a></p>
It seems to work fine.

Thanks again (and a star in appreciation)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top