The <audio> element has these attributes:
<audio controls> <source src="http://media.w3.org/2010/07/bunny/04-Death_Becomes_Fur.mp4" type='audio/mp4' /> <source src="http://media.w3.org/2010/07/bunny/04-Death_Becomes_Fur.oga" type='audio/ogg; codecs=vorbis' /> <p>Your user agent does not support the HTML5 Audio element.</p> </audio>
On mobile devices:
The adoption of HTML5 audio, as with HTML5 video, has become polarized between proponents of free and patent-encumbered formats. In 2007, the recommendation to use Vorbis was retracted from the specification by the W3C together with that to use Ogg Theora, citing the lack of a format accepted by all the major browser vendors.
Apple and Microsoft support the ISO/IEC-defined formats AAC and the older MP3. Mozilla and Opera support the free and open, royalty-free Vorbis format in Ogg and WebM containers, and criticize the patent-encumbered nature of MP3 and AAC, which are guaranteed to be "non-free". Google has so far provided support for all common formats.
Most AAC files with finite length are wrapped in an MPEG-4 container (.mp4, .m4a), which is supported natively in Internet Explorer, Safari, and Chrome, and supported by the OS in Firefox and Opera. Most AAC live streams with infinite length are wrapped in an Audio Data Transport Stream container (.aac, .adts), which is supported by Chrome, Safari, Firefox and Edge.
This table documents the current support for audio coding formats by the
|Format||Container||MIME type||Chrome||Internet Explorer||Edge||Firefox||Opera||Safari|
|PCM||WAV||audio/wav||Yes||No||Yes||Yes, in v3.5||Yes, in v11.00||Yes, in v3.1|
|MP3||MP3||audio/mpeg||Yes||Yes, in IE9||Yes||From OS[a]||Yes||Yes, in v3.1|
|AAC||MP4||audio/mp4||Yes||Yes, in IE9||Yes||From OS[a]||Yes||Yes|
|Yes||No||Yes||From OS, in v45.0||Yes||Yes|
|Vorbis||Ogg||audio/ogg||Yes, in v9||No||with Web Media Extensions||Yes, in v3.5||Yes, in v10.50||With Xiph QuickTime Components (macOS 10.11 and earlier)|
|WebM||audio/webm||Yes||No||with Web Media Extensions||Yes, in v4.0||Yes, in v10.60||No|
|Opus||Ogg||audio/ogg||Yes, in v25
(in v31 for Windows)
|No||with Web Media Extensions||Yes, in v15.0||Yes, in v14||No|
|WebM||audio/webm||Yes||No||Only via MSE
Everywhere with Web Media Extensions
|Yes, in v28.0||Yes||No|
|FLAC||FLAC||audio/flac||Yes, in v56||No||Yes, in v16||Yes, in v51||Yes||Yes, in v11|
|Ogg||audio/ogg||Yes, in v56||No||with Web Media Extensions||Yes, in v51||Yes||No|
The W3C Audio Working Group is also considering the MediaStream Processing API specification developed by Mozilla. In addition to audio mixing and processing, it covers more general media streaming, including synchronization with HTML elements, capture of audio and video streams, and peer-to-peer routing of such media streams.
On mobile devices:
The Web Speech API aims to provide an alternative input method for web applications (without using a keyboard). With this API, developers can give web apps the ability to transcribe voice to text, from the computer's microphone. The recorded audio is sent to speech servers for transcription, after which the text is typed out for the user. The API itself is agnostic of the underlying speech recognition implementation and can support both server based as well as embedded recognizers. The HTML Speech Incubator group has proposed the implementation of audio-speech technology in browsers in the form of uniform, cross-platform APIs. The API contains both:
Google integrated this feature into Google Chrome on March 2011. Letting its users search the web with their voice with code like:
Manage research, learning and skills at defaultLogic. Create an account using LinkedIn or facebook to manage and organize your Digital Marketing and Technology knowledge. defaultLogic works like a shopping cart for information -- helping you to save, discuss and share.Visit defaultLogic's partner sites below: