Play Audio In Html

HTML music codes to play music on webpage. How to add a HTML music player to your website. Also explains how to embed music for adding midi’s, mp3’s and wav sound files to your website.

How to embed music in HTML

There are several ways to embed music, midi’s, mp3 and wav files on a webpage. First you need to know the name of the music file you wish to use. If you don’t yet have any music files, you can find free music and sounds in

HTML Music Codes

The first html music code gives your visitor the choice if they want to hear the music or not.

<a href=”yourmidname.mid”>Click here to play music </a>

Make sure you upload the music file to your server. Your visitor will need something to play the music on such as a music player like Real Player or Windows Media Player. Otherwise, they will not hear the music. However, that is not a problem nowadays as virtually every PC and desktop has one.

Website Music plays automatically on page load. This is cross browser compatible

Embed this HTML music code in the <head> of your html document so music starts automatically when the page loads. Your visitor has no choice to hear it or not and there is no option to turn it off. Using the “embed” command makes your music compatible with Netscape.

< embed src=”yourmusic.mid” > < noembed> < bgsound src=”yourmusic.mid”> < /noembed>

To embed music on your website with a shut off button

You can embed music into your page so it starts automatically when someone views your page and have a small image where your visitor can turn it off.

Place the html music code where you want the button to appear on your page.

< embed src=”yourmusic.mid” width=25 height=25 autostart=false repeat=true loop=true>< /embed>

HTML music player with a console

Instead of the button, you can have a small console with on and off switches on your page such as this one below.

< embed src=”yourmusic.mid” width=”140″ height=”40″ autostart=”false” loop=”FALSE”>< /embed>

Music Parameters

To make the music play automatically the parameter is Autostart=”TRUE”

You can put “FALSE” instead of “TRUE” so the person visiting your page can chose themselves whether to play it or not.

Tinggalkan komentar

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

  • Wirausaha Mobil Bekas Pasang Iklan Rumah
  • Tulisan Terakhir

  • Kategori

  • Meta

  • Iklan
%d blogger menyukai ini: