w3schools    w3Schools
Search W3Schools :
   
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About
ADVERTISEMENTS

XML Certification
Download XML editor
Custom Programming
 
Table of contents
Media Basic
Media HOME
Media Intro
Sound Formats
Video Formats
Playing Sounds
Playing Videos
Windows Formats

Object Element
Object Intro
Object QuickTime
Object RealVideo

References
Tag Reference
Media Player Ref
MIME Reference

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Tutorials
W3Schools Forum

Helping W3Schools

 

Playing Sounds On The Web

Previous Next

Sounds can be played "inline" or by a "helper", depending on the HTML element you use.


Inline Sound

When sound is included in a web page, or as part of a web page, it is called inline sound.

Inline sound can be added to a web page by using the <bgsound> element or the <img> element.

If you plan to use inline sounds in your web applications, be aware that many people find inline sound annoying. Also note that some users might have turned off the inline sound option in their browser.

Our best advice is to include inline sound only in web pages where the user expects to hear the sound. An example of this is a page which opens after the user has clicked on a link to hear a recording.


Using A Helper (Plug-In)

A helper application is a program that can be launched by the browser to "help" playing sound. Helper applications are also called Plug-Ins.

Helper applications can be launched using the <embed> element, the <applet> element, or the <object> element.

One great advantage of using a helper application is that you can let some (or all) of the player settings be controlled by the user.

Most helper applications allows manually (or programmed) control over the volume settings and play functions like rewind, pause, stop and play.


Using The <bgsound> Element

Internet Explorer supports an element called <bgsound>.

The purpose of this element is to provide a background sound for a web page:

<bgsound src="beatles.mid" />

The code fragment above displays a MIDI file as background music for a web page.

Click here to try it yourself

A list of attributes for the <bgsound> element can be found in a later chapter of this tutorial.

Note: The <bgsound> element is not a standard HTML or XHTML element. It is supported by Internet Explorer only.


Using The <img> Element

Internet Explorer supports the dynsrc attribute in the <img> element.

The purpose of this element is to embed multimedia elements in web page:

<img dynsrc="horse.wav" />

The code fragment above displays a WAVE file embedded in a web page.

Click here to try it yourself

Note: The dynsrc attribute is not a standard HTML or XHTML attribute. It is supported by Internet Explorer only.


Using The <embed> Element

Internet Explorer and Netscape both support an element called <embed>.

The purpose of this element is to embed multimedia elements in web page:

<embed src="beatles.mid" />

The code fragment above displays a MIDI file embedded in a web page.

Click here to try it yourself

A list of attributes for the <embed> element can be found in a later chapter of this tutorial.

Note: The <embed> element is supported by both Internet Explorer and Netscape, but it is not a standard HTML or XHTML element. The World Wide Web Consortium (W3C) recommend using the <object> element instead.


Using The <object> Element

Internet Explorer and Netscape both support an HTML element called <object>.

The purpose of this element is to embed multimedia elements in web page:

<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="liar.wav" />
</object>

The code fragment above displays a WAVE file embedded in a web page.

Click here to try it yourself

A list of attributes for the <object> element can be found in a later chapter of this tutorial.


Using A Hyperlink

If a web page includes a hyperlink to a media file, most browsers will use a "helper application" to play the file:

<a href="beatles.mid">
Click here to play the Beatles
</a>

The code fragment above displays a link to a MIDI file. If the user clicks on the link, the browser will launch a helper application like Windows Media Player to play the MIDI file.

Click here to try it yourself


Previous Next


The tools you need to build your web project!

Instant Demo

Ektron CMS400.NET Version 7.6 delivers all of the flexibility and features you need to deploy the Web site you want, quickly and efficiently.

learn more...

 

 

 

6 ways to take your site to the next level with Ektron:

Social Networking Create site stickiness through social networking. Keep it personal, relevant and interactive and they'll come back for more.
Open API Keep it open. Your site needs to be ready and able to connect to outside services. Ektron's open API gives you maximum flexibility.
Document Management Streamline content and document management. Users need to quickly and intuitively find and add information.
Content Authors Empower your content authors. Reduce IT bottlenecks by allowing business users to create and edit Web content and forms.
Taxonomy Climb to the top of search rankings. SEO tools, URL aliasing and eCommerce for your digital marketing strategy
Web 2.0 Tools Add powerful Web 2.0 tools like blogs, wikis, forums, geo-mapping, rating systems and RSS feeds easily.
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today.

 
WEB HOSTING
dotnetbutton
Dynamic button image generation
$15 Domain Name
Registration
Save $20 / year!
Buy UK Domain Names
Register Domain Names
Cheap Domain Names
Cheap Web Hosting
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting
WEB BUILDING
Website Templates
Flash Templates
Website Builder
Internet Business Opportunity
Custom Programming
FREE Trial or Demo
Web Content Manager
Forms,Web Alerts,RSS
Download XML editor
FREE Flash Website
FREE Web Templates
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification
Home HOME or Top of Page Validate   Validate   W3C-WAI level A conformance icon Printer Friendly  Printer Friendly

W3Schools is for training only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user.
While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright 1999-2009 by Refsnes Data. All Rights Reserved.