Services

Featured Sites

24K Music Videos

HTML Music Codes

The <audio> element, new with HTML5, can be used to play music and other audio files in an HTML file/website.

<audio autoplay controls loop>
  <source src="file-name.mp3" type="audio/mp3">
  Any text inside this element will be shown on browsers that do not support this element...
</audio>

The audio formats supported (by most browsers, but at least by the element) are:

MP3 (audio/mpeg)
Ogg (audio/ogg)
Wav (audio/wav)

The attributes for the audio element can be used in the opening audio tag to specify various playing options:

ControlDescription
autoplaySpecify If Audio Should Play Automatically After Loading
controlsSpecify If Audio Controls Should Be Displayed
loopSpecify If the Audio Should Start Over When Finished
mutedSpecify If Audio Should Be Muted by Default
preloadUse auto, metadata, or none to Specify How the Audio Should be Pre-Loaded

The <track> tag can be used to specify subtitles, captions, and other text files that should be displayed in conjunction with media while it plays.