How to Embed Mp3 Music on a Website

It is easy to Embed Mp3 Music, Audio Files, or Songs on a Website or Webpage, so that your visitors can choose to play music in the background while they browse your site. This can be accomplished via the html audio tag.

Embedding Mp3 Music on a Website

play mp3 from site

The <audio> HTML element can be used to embed sound in a site. This eliminates the need for your visitors to install additional media player plugins to play music.

Sure you could also embed things like the Windows Media Player, but the code would not function if the user was without Windows Media Player installed on the visitors computer.

Thus, my proposed solution is to use a stand alone audio player that does not require Windows Media Player, Quicktime or any other proprietary media player be installed on the visitors machine. For this I personally prefer using simple audio tags which include a media player with volume controls, and automatic song duration calculation.

Embedded Audio Mp3 Player

Here's the code snippet to embed audio mp3 on your site:

<audio
controls
src="https://yoursite.com/song.mp3">
</audio>

Simply copy and paste the code snippet above into your html, php pages, or template file in WordPress. Then change the src=https://yoursite.com/song.mp3 to match the location of the actual audio file on your server. This should work for .wav files and some other audio formats as well.