HTML5 Audio

Audio on the Web Before HTML5, audio files could only be played in a browser with a plug-in (like flash). The HTML5 <audio> element specifies a standard way to embed audio in a web page. Browser Support The numbers in the table specify the first browser version that fully supports the <audio> element. Element <audio> 4.0 9.0 3.5 4.0 […]

HTML <audio> Tag

Example Play a sound: <audio controls> <source src=”Wild_Pogo.mp3″ type=”audio/mpeg”> Your browser does not support the audio tag. </audio> Try it Yourself » Definition and Usage The <audio> tag defines sound, such as music or other audio streams. Currently, there are 3 supported file formats for the <audio> element: MP3, WAV, and OGG: Browser MP3 WAV OGG Internet Explorer […]

HTML <audio> src Attribute

Example An audio player: <audio src=”horse.ogg” controls> Your browser does not support the audio element. </audio> Try it Yourself » Definition and Usage The src attribute specifies the location (URL) of the audio file. The example above uses an Ogg file, and will work in Firefox, Opera and Chrome. To play the audio file in Internet Explorer […]

HTML <audio> muted Attribute

Example A muted audio: <audio controls muted> <source src=”https://dwfaisalabad.com/downloads/Wild_Pogo.mp3″ type=”audio/mpeg”> Your browser does not support the audio tag. </audio> Try it Yourself » Definition and Usage The muted attribute is a boolean attribute. When present, it specifies that the audio output should be muted. Browser Support The numbers in the table specify the first browser version […]

HTML <audio> controls Attribute

Example An <audio> element with browser default controls: <audio controls> <source src=”horse.mp3″ type=”audio/mpeg”> Your browser does not support the audio element. </audio> Try it Yourself » Definition and Usage The controls attribute is a boolean attribute. When present, it specifies that audio controls should be displayed. Audio controls should include: Play Pause Seeking Volume Browser Support The numbers […]

HTML <audio> autoplay Attribute

Example An audio file that will automatically start playing: <audio controls autoplay> <source src=”horse.mp3″ type=”audio/mpeg”> Your browser does not support the audio element. </audio> Try it Yourself » Definition and Usage The autoplay attribute is a boolean attribute. When present, the audio will automatically start playing as soon as it can do so without stopping. Browser Support The […]

HTML <!–…–> Tag

Example An HTML comment: <!–This is a comment. Comments are not displayed in the browser–> <p>This is a paragraph.</p> Try it Yourself » Definition and Usage The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers. You can use comments to explain your code, which can […]