banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
May
23rd

HTML: Adding Sounds to Web Page

Author: Editor | Files under HTML Tutorials
Tags for this article: , , , , ,

You can make the web page interesting with Graphics and texts and construct an interesting web page. Then the question is, what makes the difference between any two web pages, when the input for page construction-Graphics and Text-are the same. In other words, what is the basis of considering whether a particular page is good or bad?

Surprisingly, it is the same resource-Graphics and Text-that make the difference. For example, images are used to give a different look to the overall design of the page. But the visibility or clarity of the image makes the difference. To give a classy look, the image must be clear. Once that is done, you need to put in good pieces of information because it is the quality of content that pulls visitors.

There is another way to make the web page interesting. All you have to do is ton add some music and sound to it.. These days a lot many websites are doing this to attract people to browse them. It is wonderful for when you open the site, the musical sound automatically turns on and when you navigate, it runs off. This is called adding different sounds to different pages. This is not difficult at all to add sound to your page using html programming. The following 2 options are there and they both are simple and easy.

1. Link a sound file in your computer to the web page. The people visiting the web page will download this file and then it will play
2. Embed the sound you want to play into the page itself.

We will go through both the options to see their functionality with HTML. Sounds cool, well let us go ahead to analyze the first option of linking the sound file to the web page. Now you will have a practical go at your tags. Remember the tag HREF which is used for the link. Well here we will use the same tag to link the sound. The command will look something like this.

<a href=”http://www.pageresource.com/sounds/mattdum.mid”>A Cool MIDI Song</a>

When a person clicks on this link he will be given an option to download by the browser and he can get the sound onto his computer. This is quite simple to use. So now even you can add sound to your web page. Well here MIDI type file is used. But if your sound file is of .wav, .aud or some other extension type then you can use that and create the link. Now let us see the scene when you download the song. You will be allowed to play in the player, which uses the particular extension. Once the player is run online, you have the tools present on it to start or pause the sound. This way all the controls for the sound are present with you along with the sound itself.

Next, let us see the other method of adding sound to the web page i.e. embed method. Well in the embed method you need not produce a link. You just need to embed it to the page that is the sound will play as soon as you open the page and it can be repeated all over again if you wish to. This is another cool and better way of adding sound. Here you need to specify the source of the file and other commands.

The command used for embedding the sound into your web page.

<embed src=”http://www.pageresource.com/sounds/mattdum.mid”></embed>

Post a Comment