English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <audio> Tag

Das HTML <audio>-Element wird verwendet, um Audioinhalte in einem Dokument darzustellen. Das <audio>-Element kann mehrere Audioressourcen enthalten, die mit dem src-Attribut oder dem <source>-Element beschrieben werden; der Browser wählt den passendsten aus. Für Browser, die das <audio>-Element nicht unterstützen, kann das <audio>-Element auch als nicht erkanntes Inhalt in das Dokument eingefügt werden.

Online-Beispiel

Wiedergabe von Tönen:

!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Grundlagen-Tutorial-Website(oldtoolbag.com)</title> 
</head>
<body>
<audio controls>
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
  Ihr Browser unterstützt das Element audio nicht.
</audio>
</body>
</html>
Testen Sie es heraus ‹/›

Kompatibilität der Browser

IEFirefoxOperaChromeSafari

IE 9+、Firefox、Opera、Chrome und Safari unterstützen alle das <audio>-Tag.

Anmerkung: IE 8 oder frühere IE-Browser unterstützen das <audio>-Tag nicht.

Definition und Verwendungshinweise des Tags

<audio>-Tag definiert Töne, z.B. Musik oder andere Audiostreams.
Derzeit unterstützt das <audio>-Element3Art von Dateiformaten: MP3,WAV und OGG。

BrowserMP3WavOgg
Internet ExplorerYESNONO
ChromeYESYESYES
FirefoxYESYESYES
SafariYESYESNO
OperaYESYESYES

HTML 4.01 and HTML5Differences between

The <audio> tag is a part of HTML5New tag in

Tips and Notes

Note:<audio> and </ Any text between <audio> and

Attribute

New :HTML5 New attribute in

AttributeValueDescription
autoplayHTML5autoplayIf this attribute is present, the audio will play immediately after it is ready.
controlsHTML5controlsIf this attribute is present, the audio control (such as play, pause, etc.) is displayed to the user./Pause button).
loopHTML5loopIf this attribute is present, the audio will restart playing every time it ends.
mutedHTML5mutedIf this attribute is present, the audio output is silent.
preloadHTML5auto
metadata
none
Specifies whether the audio is loaded by default when the web page is loaded and how it is loaded.
srcHTML5URL Specifies the URL of the audio file.

Global Attributes

Support for <audio> Tag Global Attributes of HTML.

Event Attributes

Support for <audio> Tag HTML Event Attributes.