How to autoplay audio on your wordpress site

The audio feature within WordPress allows you to embed audio files and play them back. This was added as of WordPress version 3.6. WordPress included the feature as a shortcode which makes use of the markup I explained earlier. The shortcode will link to specific media file or files and output the HTML. The default shortcode looks like this: To link to your files you can declare the source of the files within the shortcode which would like like this: http://audio.mp3 You can also simply include a link to an audio file like below and WordPress will render it as audio and display a player. This is my latest song http://mywebsite/media/songs/sweetsong(.audioextension) Some more content To make sure your audio plays in all browsers you need to reference other types of audio for the same file like so: http://audio.mp3 Notice how the src"" attribute was dropped and new attributes were added. In this case it is mp3=" ", ogg=" ", wav=" ". Options for Playback. The audio shortcode allows for some options for playback. src The src is an optional field but is wise to use especially if you have multiple browsers to support. The following types can be defined to allow for graceful fallbacks if a certain browser can’t render a specific audio type. mp3 mp4 ogg wav wma loop The option to automatically loop the playback of a...

Read More