How to Code an MP3 File on a Web Page

MP3 is a digital audio encoding format that allows you to compress an audio file while retaining good sound quality. You can use MP3 files on your website as background music or to showcase music that you have created yourself. Using the HTML "embed" tag, you can set the music to play automatically in the background or give users the option to control it themselves.

Instructions

    • 1

      Upload the MP3 file to your server using the method preferred by your Web host.

    • 2

      Open the Web page to which you want to add the MP3 file in your Web editor.

    • 3

      Insert the following HTML code:

      <embed src="http://www.YourMP3.com/song.mp3" autostart="true"></embed>

      Replace "YourMP3.com/song.mp3" with the complete URL for the MP3 that you want to use. This will start the music automatically when your page is loaded.

    • 4

      Save your edited Web page and upload it to your server, if necessary.

Tips & Warnings

  • Remove "autostart='true'" if you do not want the music to play automatically. Visitors can then choose whether or not they want to listen using the controls on the embedded music player.

  • If you want to play music automatically and hide the music player so that users can't control it, add the following attribute to the embed code, after the URL: "hidden='true'".

  • This code will also work on blogs and social networking pages (such as MySpace or Friendster) that allow you to edit your page with HTML code.

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured