Sounds can be played "inline" or by a "helper", depending on the HTML element you use.
声音可以在“线内”播放或作为“提示音”,主要根据你所使用的HTML元素来决定。

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.
线内声音可以通过<bgsound>元素或<img>元素添加到网页中。
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.
助手程序可以使用<embed>元素、<applet>元素或<object>元素来激发。
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
使用<bgsound>元素

Internet Explorer supports an element called <bgsound>.
IE支持<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.
上述代码片断显示了作为网页背景音乐的MIDI文件。
A list of attributes for the <bgsound> element can be found in a later chapter of this tutorial.
<bgsound>元素的属性列表可以在教程的后面章节中找到。
Note: The <bgsound> element is not a standard HTML or XHTML element. It is supported by Internet Explorer only.
注意:<bgsound>元素不是一个标准的HTML或XHTML元素。它只支持IE。

Using The <img> Element
使用<img>元素

Internet Explorer supports the dynsrc attribute in the <img> element.
IE 支持<img>元素中的dynsrc属性。
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.
上述代码片断显示了嵌套在网页中的WAVE文件。
Note: The dynsrc attribute is not a standard HTML or XHTML attribute. It is supported by Internet Explorer only.
注意:dynsrc属性不是一个标准的HTML或XHTML元素。它只支持IE。

Using The <embed> Element
使用<embed>元素

Internet Explorer and Netscape both support an element called <embed>.
IE 和 Netscape浏览器都支持<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.
上述代码片断显示了嵌套在网页中的MIDI文件。
A list of attributes for the <embed> element can be found in a later chapter of this tutorial.
<embed>元素的属性列表可以在教程的后面章节中找到。
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.
注意:<embed>元素可以同时被IE和Netscape浏览器支持,但是,它并不是标准的HTML元素或XTHML元素。万维网联盟(W3C)推荐使用<object>元素来替代。

Using The <object> Element
使用<object>元素

Internet Explorer and Netscape both support an HTML element called <object>.
IE 和 Netscape浏览器都支持名为<object>的HTML元素。
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.
上述代码片断显示了嵌套在网页中的WAVE文件。
A list of attributes for the <object> element can be found in a later chapter of this tutorial.
<object>元素的属性列表可以在教程的后面章节中找到。

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.
上述代码片断显示了嵌套在网页中的MIDI文件。如果用户点击了链接,那么浏览器助手程序如Windows Media Player将播放MIDI文件。
 
 
 
<OBJECT id=Player  codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701   type=application/x-oleobject height=300  standby="Loading Microsoft Windows Media Player Parts..."  width=350  classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
<PARAM NAME="FileName" VALUE="a.asf"><!--文件路径,根据需要修改-->
<PARAM NAME="AutoStart" VALUE="1"><!--自动播放-->
<PARAM NAME="Loop" VALUE="1"><!--循环播放-->
<PARAM NAME="ShowStatusBar" VALUE="1"><!--显示状态栏-->
<PARAM NAME="EnableContextMenu" VALUE="0"><!--屏蔽鼠标右键-->
<!--控制条参数-->
    <PARAM NAME="ShowControls" VALUE="0"><!--隐藏控制条-->
    <PARAM NAME="ShowPositionControls" VALUE="1"><!--显示位置控制-->
    <PARAM NAME="ShowAudioControls" VALUE="1"><!--显示音量控制-->
    <PARAM NAME="ShowTracker" VALUE="1"><!--显示进度条-->
  </OBJECT>
realplayer:
      <!--以下为主播放窗口-->
<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA width=400 height=200 id=RP1>
        <param name="CONSOLE" value="clip1">
        <param name="CONTROLS" value="p_w_picpathwindow">
        <param name="SRC" value="b.rm">
        <!--文件路径,根据需要调整-->
        <param name="AUTOSTART" value="1">
        <!--自动播放-->
        <param name="LOOP" value="1">
        <!--循环播放-->
        <param name="MAINTAINASPECT" value="1">
        <!--保持影片不被拉伸扭曲-->
        <param name="BACKGROUNDCOLOR" value="#000000">
<!--空白区域背景色-->
</object>
<主播放窗口结束-->
<!--以下为控制条,可根据需要选择是否在页面添加-->
 <object id=RP2 height=30 width=400 classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>
        <param name="CONSOLE" value="clip1">
        <param name="CONTROLS" value="ControlPanel">
    </object>
<!--控制条完毕-->

<object id="player" height="200" width="240" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<!--是否透明-->
<param name="wmode" value="transparent">
<param name="AutoStart" VALUE="-1">
<!--是否自动播放-->
<param name="Balance" VALUE="0">
<!--调整左右声道平衡,同上面旧播放器代码-->
<param name="enabled" value="-1">
<!--播放器是否可人为控制-->
<param name="EnableContextMenu" VALUE="-1">
<!--是否启用上下文菜单-->
<param name="url" VALUE=" http://../***.wmv">
<!--播放的文件地址-->
<param name="PlayCount" VALUE="1">
<!--播放次数控制,为整数-->
<param name="rate" value="1">
<!--播放速率控制,1为正常,允许小数,1.0-2.0-->
<param name="currentPosition" value="0">
<!--控件设置:当前位置-->
<param name="currentMarker" value="0">
<!--控件设置:当前标记-->
<param name="defaultFrame" value="">
<!--显示默认框架-->
<param name="invokeURLs" value="0">
<!--脚本命令设置:是否调用URL-->
<param name="baseURL" value="">
<!--脚本命令设置:被调用的URL-->
<param name="stretchToFit" value="0">
<!--是否按比例伸展-->
<param name="volume" value="50">
<!--默认声音大小0%-100%,50则为50%-->
<param name="mute" value="0">
<!--是否静音-->
<param name="uiMode" value="mini">
<!--播放器显示模式:Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示-->
<param name="windowlessVideo" value="0">
<!--如果是0可以允许全屏,否则只能在窗口中查看-->
<param name="fullScreen" value="0">
<!--开始播放是否自动全屏-->
<param name="enableErrorDialogs" value="-1">
<!--是否启用错误提示报告-->
<param name="SAMIStyle" value>
<!--SAMI样式-->
<param name="SAMILang" value>
<!--SAMI语言-->
<param name="SAMIFilename" value>
<!--字幕ID-->
</object>