In HTML, what is an Audio Tag?

A. Leverkuhn

In HyperText Markup Language (HTML), an audio tag is a marker for an audio file that is included in a web page. The audio tag works like other HTML tags in that it has an opening and closing piece. Some commands can fit in between for handling the sound that an HTML user codes into a web page.

Audio tags tell the web page where to locate sound files that are included in the page's presentation of information.
Audio tags tell the web page where to locate sound files that are included in the page's presentation of information.

An audio tag can reference different sound file formats, like a .wav file or the common HTML tag MP3 for playing the kinds of files that users may store on their digital music players. The person who is coding should keep in mind whether a certain browser can support an audio file event, however. Notes on browser support can be written into a web page within an audio tag structure.

Other parts of an HTML audio tag can represent choices that the webmaster makes about how the page viewer will interact with the audio file. For example, a binary autoplay command, set to true or false, can determine whether the file will start to play as soon as the page is open. Another binary command, "controls," lets the webmaster decide if controls like a play button will be available to the person surfing the Internet. Coders often call these aspects of an HTML audio tag "attributes." Other attributes of the audio tag include loop commands, where the webmaster determines how the sound will replay, and a play count feature for figuring out how many times the sound clip will repeat.

HTML is the classic standard for creating web pages, and is still very much in use. Many new tools, from styling languages like Cascading Style Sheets (CSS) to software programs like Dreamweaver®, have taken over some of the design tasks for web page creation, but HTML still provides a lot of the "hand coding" for the Internet. HTML standards are governed by the W3C, a non-profit organization creating standards for web-based computing.

The HTML audio tag is behind a lot of that sound that is heard while browsing the web. Understanding the specific attributes and uses of the audio tag can help coders or other users figure out how page makers set up their sound options, and how to improve a page or deal with the attached sound through their browser and hardware. With a little research, web users can find a lot of resources for looking at how the HTML audio tag may change in the future as Internet page making continues to evolve.

You might also Like

Discussion Comments


@ZsaZsa56 - you are right that the audio tag has been devalued, but it is not extinct just yet. There are still some developers who find it valuable, and lots of older webpages still use it without too much trouble. Like most things in web development, it has a short lifespan. Every year it becomes less and less useful.


You are right that HTML is still very much in use. In fact this very webpage is filled with it, it is the foundation of the internet. But it is my understanding that the audio tag is rarely used these days. There are a number of devices and players which are embedded on a website to provided access to audio.

Post your comments
Forgot password?