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
796
votes
20 answers

How to play audio?

I am making a game with HTML5 and JavaScript. How could I play game audio via JavaScript?
Ryan S.
  • 9,759
  • 9
  • 25
  • 39
319
votes
18 answers

Sound effects in JavaScript / HTML5

I'm using HTML5 to program games; the obstacle I've run into now is how to play sound effects. The specific requirements are few in number: Play and mix multiple sounds, Play the same sample multiple times, possibly overlapping playbacks, Interrupt…
Stéphan Kochen
  • 18,522
  • 9
  • 55
  • 48
167
votes
15 answers

HTML5 Audio stop function

I am playing a small audio clip on click of each link in my navigation HTML Code: JS…
Alok Jain
  • 2,714
  • 3
  • 19
  • 39
134
votes
7 answers

HTML5 record audio to file

What I ultimately want to do is record from the user's microphone, and upload the file to the server when they're done. So far, I've managed to make a stream to an element with the following code: var audio =…
Fibericon
  • 5,184
  • 12
  • 33
  • 61
117
votes
11 answers

How to play a notification sound on websites?

When a certain event occurs, I want my website to play a short notification sound to the user. The sound should not auto-start (instantly) when the website is opened. Instead, it should be played on demand via JavaScript (when that certain event…
Timo Ernst
  • 13,291
  • 19
  • 95
  • 153
106
votes
20 answers

How to make audio autoplay on chrome

Audio autoplay is working in Mozilla, Microsoft Edge and old Google Chrome as well but not in new Google Chrome. They have blocked the autoplay. is there any way to make it audio autoplay in Google Chrome?
Akshay Rathod
  • 1,231
  • 2
  • 8
  • 16
92
votes
9 answers

Why doesn't Firefox support the MP3 file format in

Is there a particular reason why Firefox does not support playback of MP3 files in
Mark
  • 33,211
  • 11
  • 39
  • 45
82
votes
9 answers

HTML5 Audio Looping

I've been playing with HTML5 audio recently, and though I can get it to play the sound it only ever will play once. No matter what I try (setting the properties, event handlers, etc) I can't seem to get it to loop. Here's the basic code I'm…
Toji
  • 31,923
  • 20
  • 95
  • 113
74
votes
9 answers

Setting HTML5 audio position

How to jump to certain time offsets in HTML5 Audio elements? They say you can simply set their currentTime property (emphasis mine): The currentTime attribute must, on getting, return the current playback position, expressed in seconds. On…
katspaugh
  • 15,752
  • 9
  • 61
  • 97
57
votes
1 answer

Streaming audio from a Node.js server to HTML5

I've been experimenting with binary streams in Node.js, and much to my amazement do actually have a working demo of taking a Shoutcast stream using node-radio-stream and pushing it into a HTML5 element using chunked encoding. But it only works in…
Scott Wilson
  • 1,580
  • 1
  • 15
  • 14
56
votes
6 answers

change

I have multiple audio files that I want to stream based on the user selects. How do I do that? This is what I have so far and it doesn't seem to work. *UPDATE: Made a few changes and now its claiming that audio.load(); is not a function. Can anyone…
Jmh2013
  • 2,321
  • 2
  • 22
  • 36
46
votes
4 answers

How do I play audio files synchronously in JavaScript?

I am working on a program to convert text into morse code audio. Say I type in sos. My program will turn this into the array [1, 1, 1, 0, 2, 2, 2, 0, 1, 1, 1]. Where s = dot dot dot (or 1,1,1), and o = dash dash dash (or 2,2,2). This part is quite…
dactyrafficle
  • 828
  • 8
  • 17
46
votes
4 answers

Web Audio API for live streaming?

We need to streaming live audio (from a medical device) to web browsers with no more than 3-5s of end-to-end delay (assume 200mS or less network latency). Today we use a browser plugin (NPAPI) for decoding, filtering (high, low, band), and playback…
Tony
  • 1,776
  • 2
  • 19
  • 33
40
votes
2 answers

can't seek html5 video or audio in chrome

I've been fiddling with the hell that is HTML5 video/audio for a couple of weeks now. Usually the reason why something failed popped up after a while, but I've been, unable to find why I get forwarding and rewinding problems in chrome. Anyhow... The…
toxkillfraex
  • 718
  • 1
  • 6
  • 10
38
votes
3 answers

How do you check if a HTML5 audio element is loaded?

I am wanting to know how to check if a HTML5 audio element is loaded.
auragar
  • 715
  • 2
  • 8
  • 17
1
2 3
99 100