HTML5 – Bringing Music Into Our Lives

HTML5 is the mark-up language that is used by most websites on the internet nowadays. The language was finalized in October 2014 by the W3C (or the WorldWide Web consortium). The core aims of the language are to include support for modern multimedia and keep the code readable by computers and humans alike. HTML5 was introduced with the goal of bringing a single unified markup language to internet websites, making everything more accessible. Before HTML5, websites were often coded using a combination of two different languages – XHTML and HTML. Instead of continuing with this pattern the W3C thought it would be a good idea to introduce a single language that contains the best of both languages. The language has been known among developers for years, but the layman or even beginners to web developing may not have heard of it until its initial standardized release in 2014. The first working draft of it was published in 2008. This was followed by a Last call and a candidate recommendation that took it a step-closer to being standardized for use on all modern websites. This final step was completed in 2014, much to the relief of web enthusiasts around the globe. It has been a long and arduous process to get to where we are today with HTML5. Whether you are new to the programming world or you want to brush up on your knowledge of the languages that websites use, it is a good idea to become informed of some key features of the internet's newest language. One of the best new features is related to the first aim of HTML5.

As was mentioned in the primary aims of the new unified markup language, one of the reasons it was developed was to cater for modern multimedia. The great news is that you can new include audio in HTML. Before the introduction of HTML% into our lives, you could not play audio on a web page. This was frustrating for many people, particularly since the like of mp3 files have been a part of our lives for much longer than 2014 when HTML5 was introduced. It is good that we now have the ability to play mp3 music files through HTML alone, but many people might wonder what took it so long to become reality. Before HTML5, the inclusion of mp3 files on a web page needed to be done through plug-ins such as flash. Now with some simple code, we don't need anything like that. All modern browsers support the < audio > element in HTML5. To understand how the audio element on a HTML document works, it is a good idea to look through an example:

< audio controls >
< source src="someplace.mp3" type="audio/mpeg" >
< /audio >

Let's examine this line-by-line. The controls attribute of the audio tag adds audio control features such as rewinding the file, pausing it, playing it and controlling its volume. The source attribute just links to the actual file that you want to play and the final line is just a closing of the opening audio tag. As you can see it is straightforward enough to add audio to a web page now. You can add multiple source elements to your audio tag if you want to link to an array of different mp3 files. There are currently three different audio file types supported for use in HTML by modern internet browsers. They are mp3, wav and ogg. Adding music to your website could not be easier with the introduction of HTML5 into our lives. Even if you haven't got much coding knowledge, you can experiment with the audio feature on any new web projects.