How To

How to Embed Audio in HTML

Contributor
By Charisse Van Horn
eHow Contributing Writer
(5 Ratings)

Embedding audio in a blog or website can provide users with many benefits. You can set the website or blog to automatically play a song whenever the page opens, or record a greeting for visitors to the site. You can also have audio played whenever a user places his mouse over a certain icon. Knowing how to embed audio in HTML is a great tool to use!

Difficulty: Moderately Easy
Instructions

Things You'll Need:

  • HTML code
  • Audio file (mp3 or wav)
  • Website or Blog

    Choose your Audio

  1. Step 1

    Choose an audio file. You can use an mp3 or .wav file. If you do not have an audio file, make one using any one of the freeware or shareware programs available on the Web.

  2. Step 2

    Upload the audio file to your webserver. Select the file to play on your website and make sure it is in the same directory as your website. To play an audio file on a blog that is hosted on a different server, upload the audio file to a free Web hosting company.

  3. Step 3

    Embed the audio file. Copy and paste the following code onto your website: <EMBED SRC="myaudio.mp3" VOLUME="50" HEIGHT="60" WIDTH="144">Replace the "myaudio.mp3" with the name of your audio file. Keep the quotation marks. This not only embeds the audio, but also creates a player that allows you to turn the audio on and off.

  4. Step 4

    Embed the audio file onto your blog. Change the file name in the code to the complete URL where the audio file is located. For example, using the following: <EMBED SRC="http://www.myfreewebserverhosting.com/myaudio.mp3" VOLUME="50" HEIGHT="60" WIDTH="144"> Change the name of "myaudio.mp3" to the full URL address where your mp3 is located. The embed code will create a music player.

  5. Step 5

    Adjust volume, height and width settings to match your blog or website. A width setting of "144" is recommended.

Tips & Warnings
  • Create your own mp3 file to play on your website or blog.
  • When looking for a free website to host your audio file, pay attention to the alloweable size for each download.
  • It is best to host an audio file from your own webserver.
  • Never use music or audio content that is copyrighted without autorization.

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Internet
Virginia DeBolt,

Meet Virginia DeBolt eHow's Internet Expert.

Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US

Demand Media
eHow_eHow Technology and Electronics