HTML5 Audio is a subject of the HTML5 draft specification, investigating the playing, generating and synthesising audio in the browser. It includes audio input, playback, audio synthesis, as well as speech to text.
<Audio> element
Simple playback of an audio file:
<audio src="http://developer.mozilla.org/@api/deki/files/2926/=AudioTest_(1).ogg" autoplay>
Your browser does not support the audio
element.
</audio>
This table documents the current support for audio codecs by the <audio>
element.
Trident | Gecko | WebKit | Presto | |
---|---|---|---|---|
Ogg Vorbis | No | 1.9.1 | Depends | 2.5 |
WAV PCM | 525 | 2.0 | ||
MP3 | 5.0[1] | No[2] | Depends | |
AAC | No | |||
Speex | No | No[3] | Depends | No |
Audio Data API
The current HTML5 media API provides ways to play and get limited information about audio and video, but gives no way to programatically access or create such media. The Audio Data API allows web developers to read and write raw audio data.[4] It intends to allow real-time audio processing in javascript.
Speech API
The 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 your voice to text, from your computer's microphone. The recorded audio is sent to speech servers for transcription, after which the text is typed out for you. The API itself is agnostic of the underlying speech recognition implementation and can support both server based as well as embedded recognizers. [5] 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:[6]
- Speech Input API
- Text to Speech API
Google integrated this feature into Google Chrome on March 2011.[7] Letting its users search the web with their voice by doing:
<script type="text/javascript"> function startSearch(event) { event.target.form.submit(); } </script> <form action="http://www.google.com/search"> <input type="search" name="q" speech required onspeechchange="startSearch"> </form>
See also
References
- ^ Branscombe, Mary (2010-03-16), Microsoft previews Internet Explorer 9, TechRadar UK
- ^ Bug 562730 - Reproducing Mp3 files with html5, Mozilla
- ^ Bug 476752 - support the speex voice codec in <audio> and <video> elements, Mozilla
- ^ "Audio Data API". Retrieved January 28, 2012.
- ^ "API draft". Retrieved January 28, 2012.
- ^ "HTML5 Spech API". Retrieved January 28, 2012.
- ^ "Talking to your computer". Retrieved January 28, 2012.