Questions tagged [html5-audio]

The audio element is used to embed sound content in an HTML or XHTML document. The audio element was added as part of HTML5.

HTML5 defines a new element which specifies a standard way to embed an audio file on a web page: the <audio> element.

The control attribute adds audio controls, like play, pause, and volume.
You should also insert text content between the <audio> and </audio> tags for browsers that do not support the <audio> element.
The <audio> element allows multiple <source> elements. <source> elements can link to different audio files. The browser will use the first recognized format.

Read on at w3c HTML5 Audio. More information can also be found on Wikipedia.

Related Articles:

3259 questions
37
votes
9 answers

HTML5 Audio can't play through Javascript unless triggered manually once

I'm trying to get a small sound file to play automatically using an tag and javascript to initiate it. And then through javascript, at the…
Jonah H.
  • 1,660
  • 3
  • 19
  • 31
36
votes
3 answers

How to detect HTML5 audio MP3 support?

I know how to check in Javascript if HTML5 audio playback is available. But how do I specifically check if MP3 audio playback is available, as IE9 and Chrome support it, while Firefox and Opera do not.
footy
  • 5,403
  • 12
  • 45
  • 95
36
votes
2 answers

How can I add multiple sources to an HTML5 audio tag, programmatically?

A lot of examples demonstrate multiple source tags nested in the audio tag, as a method to overcome codec compatibility across different browsers. Something like this -
Abhishek Mishra
  • 4,984
  • 8
  • 34
  • 38
35
votes
4 answers

html 5 audio tag width

I was wondering if it's possible to set the width of the audio tag. It is not a supported feature by default, so "hacks" will be happily accepted. I already tried putting them in small div's and tables, but that doesn't look very smooth... As far as…
user704063
  • 353
  • 1
  • 3
  • 4
32
votes
1 answer

MediaElementAudioSource outputs zeros due to CORS access restrictions local mp3 file

I have the following html page that I'm trying to show a class for demonstrating an audio visualizer with an mp3 stored locally: