Вы находитесь на странице: 1из 2

8/3/13

HTML5 Audio
Search w3schools.com: Select Language

HOME

HTML

C SS

JAVASC RIPT

JQUERY

XML

ASP.NET

PHP

SQL

MORE...

R EFER ENC ES

EXAMPLES

FO R UM

ABO UT

Get Certified
Study Web Technologies and get a diploma at w3schools.com

New Upcoming Projects


www.99acres.com/New_Projects 1/2/3/4 BHK Flats/Apts in ur Budget Search by Locality,Price,Amenities.

SHARE THIS PAGE

Like

76k

HTML Basic
HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Formatting HTML Links HTML Head HTML CSS HTML Images HTML Tables HTML Lists HTML Blocks HTML Layout HTML Forms HTML Iframes HTML Colors HTML Colornames HTML Colorvalues HTML JavaScript HTML Entities HTML URL Encode HTML Quick List HTML Summary HTML XHTML

HTML5 Audio
Previous
HTML5 provides a standard for playing audio files.

WEB HOSTING

Next Chapter

Best Web Hosting eUK Web Hosting UK Reseller Hosting Domain, Hosting & Email

Audio on the Web


Until now, there has not been a standard for playing audio files on a web page. Today, most audio files are played through a plug-in (like flash). However, different browsers may have different plug-ins. HTML5 defines a new element which specifies a standard way to embed an audio file on a web page: the <audio> element. WEB BUILDING
Download XML Editor FREE Website BUILDER FREE Website C reator Best Website Templates

Browser Support

STATISTICS
Browser Statistics OS Statistics

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the <audio> element. Note: Internet Explorer 8 and earlier versions, do not support the <audio> element.

Display Statistics

HTML5 Audio - How It Works


To play an audio file in HTML5, this is all you need:

Example
< a u d i oc o n t r o l s > < s o u r c es r c = " h o r s e . o g g "t y p e = " a u d i o / o g g " > < s o u r c es r c = " h o r s e . m p 3 "t y p e = " a u d i o / m p e g " > Y o u rb r o w s e rd o e sn o ts u p p o r tt h ea u d i oe l e m e n t . < / a u d i o >
Try it yourself 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.

HTML5 News
HTML5 Intro HTML5 New Elements HTML5 Canvas HTML5 SVG HTML5 Drag/Drop HTML5 Geolocation HTML5 Video HTML5 Audio HTML5 Input Types HTML5 Form Elements HTML5 Form Attributes HTML5 Semantic HTML5 Web Storage HTML5 App Cache HTML5 Web Workers HTML5 SSE

Audio Formats and Browser Support


Currently, there are 3 supported file formats for the <audio> element: MP3, Wav, and Ogg: Browser Internet Explorer 9+ Chrome 6+ Firefox 3.6+ Safari 5+ Opera 10+ MP3 YES YES NO YES NO Wav NO YES YES YES YES Ogg NO YES YES NO YES

HTML Media
HTML Media HTML Object HTML Audio HTML Video HTML YouTube

MIME Types for Audio Formats


Format MP3 Ogg Wav MIME-type audio/mpeg audio/ogg audio/wav

HTML Examples
HTML Examples HTML Quiz HTML5 Quiz HTML Certificate HTML5 Certificate

HTML References
HTML Tag List HTML Attributes

HTML5 Audio Tags


Tag Description

w3schools.com/html/html5_audio.asp

1/2

8/3/13
HTML Events HTML Canvas HTML Audio/Video HTML Doctypes HTML Colornames HTML Colorpicker HTML Colormixer HTML Character Sets HTML ASCII HTML ISO-8859-1 HTML Symbols HTML URL Encode HTML Lang Codes HTTP Messages HTTP Methods Keyboard Shortcuts <audio> <source> Defines sound content

HTML5 Audio
Defines multiple media resources for media elements, such as <video> and <audio>

Previous

Next Chapter

Azure Explorer - Free


www.cerebrata.com Manage your Windows Azure Storage with Windows Explorer like GUI. Try

Top 10 Tutorials
HTML Tutorial HTML5 Tutorial C SS Tutorial C SS3 Tutorial JavaScript Tutorial jQuery Tutorial SQL Tutorial PHP Tutorial ASP.NET Tutorial XML Tutorial

Top 10 References
HTML/HTML5 Reference C SS 1,2,3 Reference C SS 3 Browser Support JavaScript HTML DOM XML DOM PHP Reference jQuery Reference ASP.NET Reference HTML C olors

Examples
HTML Examples C SS Examples XML Examples JavaScript Examples HTML DOM Examples XML DOM Examples AJAX Examples ASP.NET Examples Razor Examples ASP Examples SVG Examples

Quizzes
HTML Quiz HTML5 Quiz XHTML Quiz C SS Quiz JavaScript Quiz jQuery Quiz XML Quiz ASP Quiz PHP Quiz SQL Quiz

Color Picker

Statistics
Browser Statistics Browser OS Browser Display

RE P O RT E RRO R

HO ME

TO P

P RI N T

FO RU M

A BO U T

A D V E RT I SE WI T H U S

W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use and privacy policy. C opyright 1999-2013 by Refsnes Data. All Rights Reserved.

w3schools.com/html/html5_audio.asp

2/2

Вам также может понравиться