Adding Audio to a Web Page

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter 13.  Adding Video and Audio


The best audio for the Web is MP3 because of its small file size and high quality. You can use several audio formats, which include file types such as WAV, AIF, RA, RAM, and RMF, to name a few.

Linking to Audio Files

The easiest way to add sound to your Web pages is to link to it. Select whatever text, image, or object you'd like to use to activate the audio, and when the end user clicks it, it automatically launches the associated media player to handle that file. If the QuickTime player needs to be launched, a new browser window opens holding the QuickTime player, much like when linking to video files. To link to an audio file, follow these steps:

  1. Select text, image, or any object that you want to trigger the audio file.

  2. In the Properties Inspector in the link text field, enter the path of the audio file you want to play. You can also browse for the file by clicking the folder icon to the right of the text field.

  3. You have no control over where or how the media player will appear when linking audio; however, if you embed it, as described in the next section, you'll see how you can control the appearance a bit more.

Embedding Audio Files

When you embed audio into your Web site, you are offering a more integrated approach than linking audio. When it's embedded, it's actually part of the Web page. You also have more control over the audio in terms of volume, visible controls, and starting and ending points. To add sound, you must use the plug-in object in Dreamweaver; unfortunately there is no sound or audio category in the Assets panel. To insert audio, follow these steps:

  1. Place a blinking cursor in the area of the page where you want to insert the audio.

  2. Under the Media tab of the Insert panel, click the Insert Plug-in button, or choose Insert, Media Plug-in. This opens a Select Files dialog box.

  3. In the Select Files dialog box, choose the file you want to play in the document. Choose OK (Mac) or Select (Windows).

  4. A default plug-in placeholder is inserted into the document.

  5. You can resize the plug-in by grabbing the resize handles and dragging, or you can enter in values for the H and W fields in the Properties Inspector.

Embed Attributes

To have the audio playing in the background, you can add a "hidden" attribute to the <embed> tag. This will make the audio have a more integrated feeling because it will be seamless without the visibility of a media player.

You can use a variety of attributes to control the appearance or visibility of a media player. In the Properties Inspector, click the Parameters button to launch the Parameters dialog box. Here are the most popular attributes or parameters:

 Parameter   hidden, value = true  Parameter   autostart, value = true Parameter   loop, value = true 

    Team-Fly    
    Top


    Macromedia Dreamweaver MX Unleashed
    Macromedia Dreamweaver MX 2004 Unleashed
    ISBN: 0672326310
    EAN: 2147483647
    Year: 2002
    Pages: 321

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net