AdNow

loading...

Etiqueta HTML audio

Etiqueta HTML <audio>


Ejemplo

Reproducir un sonido:
<audio controls>
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
  Your browser does not support the audio tag.
</audio>
Inténtalo tú mismo "

Definición y uso

La etiqueta <audio> define el sonido, como la música u otras transmisiones de audio.
Actualmente, hay 3 formatos de archivo admitidos para el elemento <audio>: MP3, WAV y OGG:
BrowserMP3WAVOGG
Internet ExplorerYESNONO
ChromeYESYESYES
FirefoxYESYESYES
SafariYESYESNO
OperaYESYESYES

Tipos MIME para formatos de audio

FormatMIME-type
MP3audio/mpeg
OGGaudio/ogg
WAVaudio/wav


Soporte del navegador

Los números en la tabla especifican la primera versión del navegador que es totalmente compatible con el elemento.
Element
<audio>4.09.03.54.010.5

Diferencias entre HTML 4.01 y HTML5

La etiqueta <audio> es nueva en HTML5.

Consejos y notas

Consejo: Cualquier texto dentro de entre <audio> y </audio> se mostrará en los navegadores que no admitan la etiqueta <audio>.

Atributos

AttributeValueDescription
autoplayautoplaySpecifies that the audio will start playing as soon as it is ready
controlscontrolsSpecifies that audio controls should be displayed (such as a play/pause button etc)
looploopSpecifies that the audio will start over again, every time it is finished
mutedmutedSpecifies that the audio output should be muted
preloadauto
metadata
none
Specifies if and how the author thinks the audio should be loaded when the page loads
srcURLSpecifies the URL of the audio file

Atributos globales

La etiqueta <audio> también admite los atributos globales en HTML .

Atributos del evento

La etiqueta <audio> también admite los Atributos del Evento en HTML .

páginas relacionadas

Referencia de HTML DOM: Referencia de HTML Audio / Video DOM

Configuración CSS predeterminada

Ninguna.

Formulario de contacto

Nombre

Correo electrónico *

Mensaje *

Entradas más populares de este blog

Listado pasaporte y cedulas SAIME 2018

Etiqueta HTML < abbr >

HTML < a > tag

Visitas a este blog