Description A replacement for the HTML5 audio tag. The amp-audio component is only to be used for direct HTML5 audio file embeds.
Availability Stable
Required Script <script async custom-element="amp-audio" src=""></script>
Supported Layouts fixed, fixed-height, nodisplay
Examples Annotated code example for amp-audio


The amp-audio component loads the audio resource specified by its src attribute at a time determined by the runtime. It can be controlled in much the same way as a standard HTML5 audio tag. Like all embedded external resources in an AMP file, the audio is "lazily" loaded, only when the amp-audio element is in or near the viewport.

The amp-audio component HTML accepts up to three unique types of HTML nodes as children - source tags, a placeholder for before the audio starts, and a fallback if the browser doesn’t support HTML5 audio.

source tag children can be used in the same way as the standard audio tag, to specify different source files to play.

One or zero immediate child nodes can have the placeholder attribute. If present, this node and its children form a placeholder that will display instead of the audio. A click or tap anywhere inside of the amp-audio container will replace the placeholder with the audio itself.

One or zero immediate child nodes can have the fallback attribute. If present, this node and its children form the content that will be displayed if HTML5 audio is not supported on the user’s browser.

For example:

<amp-audio width="400" height="300" src="">
  <div fallback>
    <p>Your browser doesn’t support HTML5 audio</p>
  <source type="audio/mpeg" src="foo.mp3">
  <source type="audio/ogg" src="foo.ogg">



If present, the attribute implies that the audio will start playing as soon as it is ready.


If present, will automatically loop the audio back to the start upon reaching the end.


If present, will mute the audio by default.

common attributes

This element includes common attributes extended to AMP components.


See amp-audio rules in the AMP validator specification.