Chapter 18

Multimedia and Animation on the Web

by John Jung


CONTENTS

By now, you know how to create some nice-looking Web pages with some general HTML tags. But there's so much more you can do to get your point across on your Web page. Most people use pictures and lots of links, but you need something more. If you want your Web page to really stand out, you're going to need something that really gets a person's attention. You need multimedia. I'm not saying that multimedia is necessary for all Web pages; it does have its drawbacks.

If you want to know about multimedia and Web pages, you can find the answers in this chapter. You learn when you should and shouldn't use multi-media files and why multiple multimedia formats should be provided. And you also go through some of the more popular multimedia formats and learn how to view them.

In this chapter, you learn about the following:

What Is Multimedia?

Multimedia is many things to many people. Unfortunately, no universally agreed upon definition of multimedia exists. Generally speaking, multimedia is a combination of sights and sounds. It can be pictures and words, words and sounds, or pictures and sounds or all three. Multimedia might not sound terribly difficult, after all, because TV and movies use it all the time. The difference is that with traditional forms of media, the images and sounds are in a physical form. When it comes to computers, multimedia can be a processor and disk- space intensive process. The results are astounding, but you get a payoff.

So what is multimedia, really? It's simply moving pictures and sounds. You don't necessarily need both components to have a multimedia file, although that would be nice. Each element of multimedia is often considered to be multimedia itself. That is, many people consider just playing sound files over the Net to be using multimedia. Similarly, they also feel that because they can see a movie using their computer, that movie is multimedia. By and large, whenever somebody mentions multimedia, he or she is talking about moving pictures, hearing sounds, or both. The fact that this process is accomplished using a computer is what's amazing to them.

The Sound Component

Computers that can play sounds are nothing new; they've been around for years. The problem was always getting a computer that had a speaker of reasonable quality. With improvements in computer technology, the sound quality has dramatically increased. Also, the fact that computer prices are now lower makes the use of sound-capable computers even more widespread.

All of this information is pretty unimpressive to many people who use computers. The truly impressive thing is that sound files can now be played over the Internet. This fact is significant because the capability to play sound overcomes a few of the shortcomings that exist on the Net. The first big obstacle was the desire to support the lowest common denominator. This always meant supporting generic text terminals with no graphics or sound. The second obstacle was the lack of demand for such features. The Net was originally made up of mainly programmers and engineers working from workstations. Workstations have little or no sound support, and what exists is not consistent across different platforms.

Sound Files

A number of sound file formats are in fairly wide use, such as Dialogic VOX, SoundBlaster VOC, and Amiga MOD. You can listen to most of them if you have the correct sound player utility. You must then use each of these players as a helper application for your browser.

Probably the most widely supported sound format is the WAV file format. This robust format allows you to encode stereo and mono sounds. You can also specify the degree with which to store the sounds. Most sound playing utilities support the WAV format without a problem.

Another popular sound format is the Audio IFF (AIFF), introduced by Apple. This was intended to be used as a means of storing high-quality sound and musical instrumentation. It's also been adopted by Silicon Graphics (SGI) in their workstations. This format has spawned the AIFF-C format, which is basically the AIFF format, except compressed. Aside from Apple and SGI, a handful of companies also support the AIFF format. Most sound players will have no problems supporting the AIFF format.

There is also the sound file format developed by Sun Microsystems and NeXT, the audio (AU) sound file. This is typically seen and supported the most in workstation environments. Also, some browsers will support the AU format without the need of getting an external program. Because of its strong workstation roots, many sound playing programs can handle AU files.

The Animation Component

Besides sound, another aspect of multimedia involves animation. Animation is, simply put, just a bunch of still pictures, one slightly different from another. This process is exactly how movies are shown, with each frame of the movie being played for a fraction of a second. When the frames are played backed at a certain rate, the frames show the animation. And in animation, just like movies, you don't necessarily need to have sounds. The silent films are still movies and considered multimedia even though they have no voices or sounds.

Animation Files

A number of attempts have been made to standardize the animation portion of multimedia. Often these formats were either too machine dependent or not robust enough, such as the GL, DL, and ANIM formats. The majority of these older animation formats basically took a bunch of pictures and strung them together. Almost none of them used any degree of sophistication to reduce the file size of the resulting movie. The most prevalent animation format in use is the MPEG format, which you learn about later in this chapter.

Letting People Know About Multimedia

Even though you might want to rush out and put multimedia files all over your Web page, don't. You should tell people what, when, and where certain multimedia files are located. Multimedia files should be a means of enhancing your Web pages, not replacing them. Don't include critical information that can be found only in the multimedia files.

Not Everybody Can Handle Multimedia

Multimedia files require fairly computer-intensive programs to view properly. Very few Web browsers provide support for multimedia files by themselves. As a result, most of the time you must configure your browser to run programs capable of showing multimedia files. Getting multimedia viewers is no trivial task, which means most people's computers don't automatically support multimedia files. Because of the work required for making a browser multimedia-capable, you should always warn people where you have multimedia files (see fig. 18.1).

Figure 18.1 : Letting people know where multimedia files are located is always a good idea.

Letting the Users Decide When to See Multimedia

Another good idea is to not force multimedia files onto users. Although you can have sound files play as soon as a user accesses a page, that's not a good idea. The file has to be downloaded from the Web server to the person's computer. After that, the user has to wait for the sound player to start up and play the sound file. Although this process might be fast and unnoticeable for people with high-powered machines directly on the Net, most people don't have setups like that. Most people accessing the Net are doing it from modems, and they have to wait to get your files.

Putting in automatic multimedia files simply wastes users' time and detracts from their enjoyment of your home page.

Making Multiple Formats Available

A large number of computers can access your Web page, and most of them have their own particular brand of multimedia file formats. You should not make a multimedia file available in only one format. Cover your bases and convert (or redo) your multimedia file into multiple formats (see fig. 18.2). This way, you can make your pages more accessible to the typical users and make them more interested in coming back.

Figure 18.2 : Convert your multimedia file into as many different formats as possible. The more formats you have, the more people you attract.

Different Files, Same Content

When you're making multiple file formats available, try to make the multimedia files in the different formats show the same thing although doing so might take a lot of work. Don't leave the sound out of one of the formats just because including it is a lot of work. You can use any of a number of multimedia converters (which are covered later in this chapter) for different computers.

Some converters convert all aspects of a multimedia file, whereas others won't. If necessary, don't be afraid to re-record your multimedia file through a different interpreter for a different format. This process may be time-consuming, but the users will appreciate the work. Re-recording is especially important for people running commercial Web sites.

Note
Obviously, re-recording multimedia files into different formats is a big undertaking. As a result, only companies running commercial Web sites should do it.

Different Computers, Same File

Another aspect of making your multimedia files available to everybody is the format in which they're stored. I'm not talking about multimedia file formats, but the format in which the data is stored.

On Windows 95 and UNIX machines, files are stored in a particular fashion. On Macintosh computers, certain aspects of a file can be stored differently. Because of this format, some Mac files (of any sort) can't be properly read by Windows 95 or UNIX programs.

Typically, the programmers leave it up to the users to get the files into a format recognizable to a particular program on a certain machine. This process often involves having the users get a Mac-to-PC conversion program, putting the file on a PC disk, and reading the data off that disk.

Because the Mac has a slightly quirky file storage method, Mac multimedia people found a way around this conversion process. They allow some multimedia formats to be stored in only one manner. This process basically involves loading a Mac multimedia file into a program and saving all the data into a file that everybody else can read. Any multimedia file that goes through this process is "flattened."

Note
Currently, you can flatten only Apple MOV files on the Mac. Unfortunately, you must have the complete QuickTime developer's package to be able to flatten MOVs.

In contrast, the files stored on Windows 95 and UNIX machines can be read by Mac multimedia players without being flattened. Other multimedia file formats don't have this problem because they were designed with either Windows 95 or UNIX in mind.

Note
There are two attributes to any files stored on a Macintosh. These two attributes are known as the "resource fork" and the "data fork." Every file on a Mac disk has these attributes, but it isn't necessary to use both of them. Unfortunately, no other popular computers support the resource and data forks. As a result, when you try to copy a file from a Mac to a PC, resource and data forks are squished together. This is bad.
A "flattened" MOV file is one in which all the MOV data is stored in one fork. Flattening MOVs is essential if you want your animation files to be seen by everybody. For obvious reasons, you can only flatten an MOV file while using a Mac.

Size Considerations

Another major concern in using multimedia files in your Web page is that you should look out for is the size of the multimedia file. Because multimedia formats can have animation and sound, they can be quite big. Therefore, always telling people how big your multimedia files are is a good idea. This way, you can let people know about how long they have to wait before they can see what you have on the page. Remember that the majority of people accessing Web sites are doing so from the comfort of their homes. Many large multimedia files will take well over five minutes to download on a typical system.

Just How Big Is Too Big?

Giving exact numbers on when a file becomes too big to be useful for a home page is very difficult. You should always consider your target audience before you include any multimedia files on your Web page. Most company and personal home pages try to attract everybody on the Net. Because of the different file formats, giving a good estimate for a file size is also difficult. Also, because there are so many possible system configurations, the same file won't necessarily play at the same rate on all systems.

If you're determined to have multimedia files in your home page, then make sure the file is about 300K in size. This size gives you about 10-15 seconds of animation without sound. Include sound, and you'll halve the amount of time to 5-7 seconds. Also, a typical 300K multimedia file can be transferred in 2-3 minutes. If the size seems a bit small, that's the point. You can't have large multimedia files that aren't intrusive to a significant portion of people on the Net. You need to use small multimedia files for points you really want to emphasize.

If you're interested in making multimedia files only for those users who are truly interested in your topic, then you have no restrictions. Because these people are already interested in seeing what you have, they'll wait for the download to complete. Just be sure to tell everybody how big your files are so that people with slow connections don't get upset at how long it takes to get the files.

File Compression

Should you compress files? This question is also tough to answer because whether you compress files depends on how much you want to emphasize multimedia. If you have large multimedia files available for users truly interested in a topic, file compression is always available.

Some file formats compress better than others, but typically you get a 1-30 percent smaller file. Compressing allows you to cram in an extra few seconds of multimedia. The trade-off here is that the users typically have to decompress the files on their end.

File compression is the single biggest reason that home pages cannot have integrated multimedia. Most browsers are smart enough to run a downloaded file automatically through a particular application. However, they aren't smart enough to run the resulting file through two applications. This means that if you have multimedia as an integral part of your home page, you can't compress the files.

If you choose to compress your multimedia file, you should use popular compression software. For Windows 95 users, that means you should use ZIP, by PKWare, to compress your files. ZIP offers good, but not the best, compression available and is the most popular format. Mac users should use StuffIt, or one of its many derivations, by Aladdin Software. Again, it's a very popular program that offers good compression rates. Both these programs are widely available on many FTP sites.

MPEG: What It Is and How to See It

One of the most popular multimedia formats is MPEG. Numerous MPEG viewers are available for Windows 95 and the Macintosh. There are also a handful of UNIX MPEG players, typically requiring you to compile it yourself. Most MPEG animation files are either silent or have an accompanying sound file. Very few MPEG files on the Net have sound embedded within the animation files themselves.

MPEG is perhaps the safest multimedia file format you can use for your home page. It has the widest support of all multimedia formats on all platforms-not just in software but in hardware as well. Most new video cards released have built-in MPEG support. And if that weren't enough, MPEG files are almost always smaller than any other multimedia format.

Overview of MPEG

MPEG got its name from its creators, the Moving Pictures Experts Group. This group defined a method of storing animation and sound files efficiently. Their first attempt at this standard resulted in what is known as MPEG 1 (more commonly called MPEG). The target audience for the MPEG 1 standard is the casual computer user playing animation files over a CD-ROM. Since that time, the group has improved MPEG by making it more efficient and improving its quality. Its next upgrade of MPEG 1 resulted in MPEG 2, which is targeted for the broadcast market. MPEG 3 was intended to be a modification of MPEG to be aimed at the HDTV (High Definition TV) market. It was abandoned when it was discovered that MPEG 2 could be slightly altered to meet that need. The latest modification to MPEG is the MPEG 4 format and is being targeted for the fiber-optics market. It is still under discussion and is expected to be completed before the turn of the century. Most MPEG players currently in use can display only MPEG 1 files because very few people are interested in making MPEG 2 files.

The MPEG 1 standard involves encoding each frame of the MPEG file through a number of mathematical gymnastic feats. The audio and video frames of an MPEG file can each be encoded by three different methods. Rather than my explaining all the math involved, just be happy to know that the process is complicated. As a result, very few MPEG players can handle all aspects of the standard.

MPEG on Windows 95

A rather large number of MPEG players is available for Windows 95. The leader of this pack is VMPEG Lite by Stefan Eckhart. VMPEG can decode all MPEG 1 video frames and a limited number of audio frames. VMPEG is a native Windows 95 application, meaning that it's a 32-bit program. VMPEG Lite is a demonstration version and limits the amount of audio that can be played to 60 seconds. The full version of VMPEG has no such time limitation and includes video CD playback. When you first run VMPEG, a window with a menu and four VCR-like buttons shows up. Underneath this window is a separate window where the MPEG animation is shown (see fig. 18.3).

Figure 18.3 : VMPEG gives you two windows; one controls the output of the other.

The menu in the main window mainly consists of configuration of VMPEG. You can go to the Configure menu to configure each component of VMPEG playback. Under the Configure menu, the Audio menu item allows you to specify the sound output of MPEG files. Most of the sound configuration options should be obvious.

The video configuration for VMPEG is similarly straightforward. The four buttons in the main window allow you to play, stop, pause, and step to the next frame of the MPEG file. You can get VMPEG Lite from the following:ftp://ftp.netcom.com/cf/cfogg/vmpeg/vmpeg17.exe

MPEG on Macintosh

Macintosh users can also view MPEG files with a very good viewer, Sparkle by Maynard Handley. This program runs under System 7.0 or later and offers you the ability to read and play back most MPEG 1 files. Simply run BinHex and StuffIt to decompress the file into its own directory, and then double-click the Sparkle icon. The result is shown as in figure 18.4.

Figure 18.4 : Sparkle is a good MPEG player for the Mac.

After a file has been loaded, you can play the file by clicking the Play button in the lower-left corner. You can also drag the scroll box at the bottom to anywhere in the MPEG file. The two buttons in the lower-right corner allow you to go forward and backward one frame at a time. Sparkle offers no configuration options and no sound support.

You can get a copy of Sparkle in BinHex at the following:

ftp://wuarchive.wustl.edu/system/mac/info-mac/gst/mov/sparkle-25.hqx

Creating MPEGs

Since MPEG was first introduced, there haven't been a lot of MPEG creation utilities. This is because MPEG was designed to encode broadcast television signals. As a result, the most common place you'll find MPEG encoders is with specialized video cards. These cards allow your computer to accept television signals and play them on your monitor. Most of these video cards have software that lets you save a captured sequence from the television as an MPEG file.

QuickTime MOVies

Apple has its own standard for storing multimedia files; it is known as QuickTime Movies. The standard was designed with the Apple Macintosh line of computers in mind. It has since migrated to other computers, most notably Windows 95. As mentioned before, MOV files can be correctly viewed on computers other than the Mac if the files have been "flattened." Apple also provides a fair amount of support for people wanting to develop MOV applications.

Watching MOVs on the Mac

Because MOV was designed by Apple, several viewers for the Macintosh are available. Despite this wide variety of MOV players, however, the best one is, logically, from Apple itself. Movie Player implements all aspects of the MOV standard.

To play an MOV file using Movie Player, you simply choose File, Open. The first frame of the movie shows up in a window with some control buttons (see fig. 18.5). You can adjust the volume of the playback using the lower-left button (it looks like a speaker). Next to this button is one that starts the playback process. As the movie is playing, this button turns into a pause button, which you can use to stop the animation. Also while the movie is playing, the slider moves across the play bar's region. If you paused the playback of the movie, you can drag the slider around, and the window updates to that portion of the animation. You can resize the Move Player playback window by clicking and dragging the lower-right button.

Figure 18.5 : A great QuickTime MOVie player is Movie player by Apple.

Watching MOVs on Windows 95

Playing QuickTime MOVs using Windows 95 is just as simple as it is on the Mac because Apple has faithfully ported their MOV animation player, Movie Player. The interface, menus, and behavior are all the same with the Windows 95 version as they are with the Mac version (see fig. 18.6). Some minor features aren't present in the Windows 95 version, but most users won't notice their absence. Because this version isn't on the Mac, it can play only QuickTime movies that have been flattened. You can get the QuickTime movie player by going to http://quicktime.apple.com/form-qt2win.html.

Figure 18.6 : QuickTime for Windows is a faithful port of Windows 95 of Movie Player for Mac.

Making Your Own MOVies

Because of the way QuickTime was designed, you can create your own QuickTime movie relatively easily. The first thing you need to create your own animation is to have the images of each frame in PICT format. You also need an MOV creation program for the Mac, such as MooVer. To create an MOV file, you must first have all the frames of the QuickTime movie stored in Apple PICT format. Next, you highlight all the frames you want to make into an MOV file. Now, with all the frames selected, drag all of them onto the MooVer program icon.

After you've done this, you will be presented with a dialog box asking you for some settings. Simply click the ones you want your destination MOV to have and click the OK button. Next, you'll be shown another dialog box (see fig. 18.7) to help you control the quality of the MOV. By default, MooVer will create a QuickTime file of Medium quality. The higher and better the quality, the larger your MOV file will be. You can also specify how many frames should be shown per second. The more frames you want shown each second, the smoother the QuickTime movie.

Figure 18.7 : When you create a QuickTime MOVie with MooVer, you have to specify a few attributes.

If you have a digital camera, you can also create MOV files. A digital camera is a hardware device that automatically digitizes whatever is in front of it. Most digital cameras come with software that enables you to use the digital camera as a digital camcorder. Simply have the software record whatever the digital camera sees and store it as an MOV file.

All About AVI

Another format for multimedia files is the Intel Indeo format, more commonly known as AVI. This format was designed by Intel, the maker of most CPUs in personal computers. The specifications for AVI files are well documented by Intel. However, Intel has left the implementation of its standard up to others. The platform that supports AVI the most is the Windows 95 operating system. In Windows 95, all you need to do is install the Media Player, and you'll have AVI support. Despite this wide userbase, AVI hasn't received as much support outside of the Windows 95 market as other platforms. You should consider using AVI multimedia files only if you expect a large number of Windows 95 users to access your home page.

What Went Wrong?

There are a number of reasons why AVI didn't take off until recently. Its distributed nature, in which one company defines the standard and others interpret it, didn't help. Instead of going to one company for questions about the format, the average developer had to go to two. Another reason for AVI's initially lukewarm reception is that the companies who were supposed to push it didn't. In the beginning, Microsoft and IBM were the two biggest supporters of AVI. However there was little mention or support for AVI in either Windows 3.1 or OS/2.

Another possible reason why AVI was largely ignored is because it didn't change much. MPEG has been updated numerous times in the last few years for different target audiences. Apple has added a virtual reality aspect to QuickTime, creating QuickTime VR. Compare these changes to the mostly unchanged, until recently, AVI format.

Playing AVIs

Because Windows 95 supports AVIs natively (see fig. 18.8), the only other major platform to be concerned with is Macintosh. The Mac version is available at the following:

Figure 18.8 : Windows 95 supports playing AVI files without needing a player.

ftp://wuarchive.wustl.edu/systems/mac/info-mac/gst/mov/video-for-windows-11p.hqx

Simply download the file and decompress it into its own folder using BinHex and StuffIt. No installation is required, so you can simply double-click the corresponding icon.

AVI's Comeback?

Whatever AVI's past, however, its future seems bright. It is now more heavily emphasized and supported by more companies than it has been in the past. This is partly due to Microsoft's desperate attempt to catch up in the Internet browser market. Here, Microsoft introduced their Web browser, Internet Explorer, in the largely Netscape-dominated market. Along with introducing some minor new HTML extensions, the browser also provides native multimedia support. The support is provided by allowing the browser to play AVI files without needing an external program.

Another factor that is helping AVI make a comeback is digital cameras. Most digital cameras allow the user to have real-time video capture in the computer. That is, the digital camera will automatically digitize and store an image of whatever is in front of its lens. Most digital cameras allow you to save these sequences of images as animation files. Typically you can save one of these animation files as an AVI file.

Creating Your Own AVI File

Because of AVI's long neglected past, there aren't many software-based programs to help you create them. However, if you have a digital camera, chances are very good that it will come with such software. These types of programs will continually read in the data from the digital camera and store it as an AVI file. For those people who don't have such a device, your best bet is to convert an existing file to AVI format.

Real-Time Sound

Generally speaking, most people make multimedia files available just like other files. That is, people browsing the Web must download the files and then use helper applications to play them. This approach, however, isn't always the best way to get your point across to people. Another method is to have the multimedia file play directly over the Net. That is, as the data is received from the remote host, it plays through an application. One such real-time multimedia application is RealAudio.

What Is RealAudio?

RealAudio is a generic Web browser helper application, created by Progressive Networks. This add-on allows you to play sound files in real time. When you click a RealAudio sound file from your browser, it starts the RealAudio program. This application takes the URL from your Web browser and retrieves the sound file over the Net. As the data is received from the remote host, it's instantly played by RealAudio.

Because RealAudio requires its own server, it's not something many people want or can use. More often than not, RealAudio is supported by sound-related companies. They typically include radio stations and music companies. Many of these entities make samples of their format or their artists available in RealAudio format.

What's So Great About RealAudio?

You may be interested in RealAudio if you're running a corporate Web site. This application takes the burden of sound playing off Netscape. Whereas Netscape has to download the file and have a helper application play it, not so with RealAudio. Netscape passes the sound-playing responsibility to RealAudio. This means that while the sound file is being played, you can continue to use Netscape.

How Can I Support RealAudio?

Unfortunately, because RealAudio delivers sound files in real time, you need to modify the server. You don't have to replace it, just add on to it. The RealAudio server works with any Web server that supports configurable MIME types. Most server software falls into this category, but a complete list is available from RealAudio at the following:

http://www.realaudio.com/products/server/software.html

Also, because the sounds are sent in real time, the sound files must be converted. The conversion program automatically converts most common sound formats into the RealAudio format. The biggest drawback is that the file conversion is slow. If you want to convert a sound file that takes 20 minutes to play, on a fast computer the file takes 20 minutes to convert. Converting sound files on slower machines can take up to twice as long.

How Do I Get RealAudio?

Because Progressive Network is so protective of its invention, they want to know who's getting it. As a result, you need to point your Web browser to the following:

http://www.realaudio.com/products/player.html

Just fill out the forms on the page, making sure to fill in all the requested information. If you don't have a particular bit of information they want, such as company name, just put anything in. After you've filled out the form, you can download the RealAudio player.

The RealAudio player that you download is a self-extracting archive file. All you have to do is double-click the file, and its installation program automatically starts up for you. You specify which components of RealAudio you want to install, as well as the destination directory.

Then, any time you're in Netscape and click a hyperlink that points to a RealAudio file, the player runs, as shown in figure 18.9. The player gets the URL from Netscape, gets the sound file itself, and plays it for you. This way, you can continue using Netscape while the sound file is being played.

Figure 18.9 : RealAudio's sound player is automatically activated when you click a sound file from a Web page.

Caution
The biggest drawback to using RealAudio is that it currently works best over 28.8 kbps modems. Although RealAudio can work over 14.4 kbps modems, most RealAudio servers are going the 28.8 route. That means that people either need to have a really fast modem or a direct connection to the Net to fully appreciate RealAudio. Anything less than a 28.8 modem results in poor sound quality.

Putting RealAudio in Your Home Page

As complicated as using RealAudio may sound, putting it in your Web page is easy. All you really have to do is create a hyperlink that people can click to access the sound file. Instead of putting in an anchor reference that points to an image, for instance, just have it point to the sound file. A typical example of supporting RealAudio is

Hear my <A HREF="myvoice.ram">voice</A>.

This line creates a hypertext link with the word "voice" to the RealAudio sound file. When a user with the RealAudio plug-in clicks the link, the URL is passed onto the RealAudio player. The player then gets the sound file directly from your Web server and plays it back in real time.

Multimedia in Your Home Page

One of the most impressive things you can do with your home page is to access interactive multimedia files. As complicated as this process may sound, it's not really that hard. You can use a new Netscape plug-in from Macromedia; it's called Shockwave. Shockwave plays multimedia files created with Macromedia's Director program. Currently, this new plug-in is available to Macintosh and Windows 95 users. UNIX and Windows NT versions will be released soon.

What Can I Do with Shockwave?

Netscape Navigator allows for something known as plug-ins. Plug-ins can expand the capabilities of the Web browser by transparently supporting newer file formats. Although some plug-ins are essentially glorified helper applications, Shockwave takes full advantage of the power of plug-ins. You can easily have a regular home page that contains Director multimedia files.

Director allows not only for regular multimedia files but also for interactive multimedia. Putting files of this level onto your Web page may require a bit of work, but it is well worth the effort. You can have a multimedia tour of your office facilities, for example. When a user clicks your Director file, it can play some animation.

How Can I Support Shockwave?

Shockwave is really just another file type that needs to be supported by both the browser and the server. The browser is automatically supported after you install the Shockwave plug-in. Whenever you access a home page with a Shockwave multimedia file, Netscape downloads the file. After it's received on your end, the Shockwave plug-in plays the multimedia file. The really impressive aspect about Shockwave is that the multimedia file is played within the current home page. The browser keeps playing the multimedia file until you go to another home page.

Most Web servers can easily support Director files if you add the new MIME file type. Director has only three file extensions: DIR, DXR, and DCR. They are of the MIME type "application" and the sub-type of "x-director." After you or your administrator adds these extensions, your Web site can support Shockwave. For example, if you're using NCSA's Web server, you'll want to add the following lines to the end of the conf/mime.types file:

application/x-director DIR,DXR,DCR

How Do I Get Shockwave?

You can retrieve the Shockwave plug-in directly from Macromedia. Simply point your browser to the following:

http://www.macromedia.com/Tools/Shockwave/sdc/Plugin/index.htm

Select the appropriate operating system that you're using. Next, specify which browser you're currently using, and then specify from where you want to download it.

A number of Internet-related programs support Director files natively and don't need the Netscape plug-in. These programs include Microsoft's Internet Studio, Silicon Graphics's WebForce, and Navisoft's NaviPress. After Shock-wave is installed in your system, you can seamlessly view Director files.

Where Can I Find Director Files?

Director is a commercial program sold by Macromedia for $850. Because of its hefty price, it's unlikely that you'll find Director files in personal Web pages. Director allows you to create multimedia projects such as presentations and interactive Web pages. You can create and import two- and three-dimensional objects with Director.

For the serious multimedia developer, Macromedia also sells Director Multimedia Studio. The Studio is a collection of many Macromedia titles, includ-ing Extreme3D, xRes, and SoundEdit 16. If you get the Macintosh version, SoundEdit 16 comes with Deck II, while the Windows version comes with SoundForge XP. Director Multimedia Studio has a list price of $999. You can purchase Director and Director Multimedia Studio from Macromedia or one of their retailers.

Putting Director Files in Your Home Page

After you've bought Director and created some multimedia files, you can use them in your home page. Unfortunately, the current HTML standard has no provision for having multimedia files in your home page. The most widely used of the different extensions is the Netscape tag <EMBED>. This tag is basically the same as HTML's <IMG> tag, except that it refers to a multimedia file. The simplest way of making use of a Director file is by adding a line to your home page. The line looks something like the following:

<EMBED SRC="mymulti.dcr">

This puts the Director file as a separate HTML object by itself. This is fine in many cases, but you have to learn to treat the <EMBED> element as any other HTML tag. You can use the <EMBED> element as you use an <IMG> tag. You can easily put in a Director file in your Web page, as you can a graphic file. Because of <EMBED>'s flexibility, you can create interesting effects with Director files. For example, you can make Director files stand out by adding the following lines to your Web page:

<table border=8>
<tr>
<td>
<embed SRC="MYlogo.dcr">
</td>
</tr>
</table>

This creates a table with one data cell. In that cell is the Director file MYLOGO.DCR. This is great if you want to make your Director file stand out particularly well. MYLOGO.DCR appears in a table by itself, which makes it very hard to not be seen.

Another useful application of the <EMBED> tag is using it as a test of the user's browser. For example, suppose you have a Web site where you want people with Java-capable browsers and have Director files. You can do this by putting in the following lines:

<SCRIPT LANGUAGE="LiveScript">
<!--Beginning of LiveScript code-->
document.write('<EMBED SRC="http://www.mysite.com/mybanner.dcr">');
<!--Ending of LiveScript code-->
</SCRIPT>
<EMBED>
If you don't see my spinning logo above, you need:
<UL>
<LI>A Java-capable browser.</LI>
<LI>Shockwave installed for that browser.</LI>
</UL>
</EMBED>

For Java-capable browsers, this code loads the Director file. If the browser doesn't have Shockwave, the user is asked if he or she wants to get the plug-in. Those browsers that can't handle Java display the contents between the <EMBED> and </EMBED> tags.

You may optionally choose to specify the HEIGHT and WIDTH attributes of the <EMBED> tag. These values indicate the height and width, respectively, of the multimedia file you're using. After your browser comes across the <EMBED> tag, it automatically retrieves the multimedia file. The browser then hands off the file to Shockwave to display it properly in the browser window.

Converting Sounds

If you're planning on using sound files in your Web page, there's a good chance you already have a sound file. As a result, this sound file is probably in one particular format. To ensure that your file can be heard by as many people as possible, you'll probably need to convert the sound file. There are a number of applications on both the Macintosh and Windows 95 that can help you here.

Goldwave

GoldWave, by Chris Craig, is a solid Windows 95 sound editing program (see fig. 18.10). It allows you to read in .WAV, .AU, .IFF, .VOC, .SND, .AIFF, and raw sound files. You can easily convert an existing sound file by clicking the Open icon. Next, you'll be presented with a standard file open dialog box. Locate the sound file you want to convert and click the OK button. Select the File menu heading, followed by the Save As menu item. This opens a dialog box (see fig. 18.11) that lets you specify what you want to save the file as. Simply use the Save File as Type drop-down list and select the file format you want to save it as. Next, use the File Attributes drop-down list and choose the attributes you want for the sound file.

Figure 18.10: GoldWave is a good editor available for Windows 95 and Windows 3.1.

Figure 18.11: The File Attributes drop-down list will have different options, based on the format you want to save it as.

"Mono" sound files are smaller than "stereo" sound files. If your sound isn't recorded in stereo, you shouldn't convert the file as such. Also, "8-bit" sound files are smaller than "16-bit" sound files. 16-bit encoded sound files sound much better than 8-bit sound files. As a result, if you're not too concerned with the clarity of the sound, you should use 8-bit encoding. You can find out more about GoldWave at http://web.cs.mun.ca/~chris3/goldwave/.

SoundApp

Mac users can also easily convert sound files to other formats with SoundApp. This program, by Norman Franke, allows you to read in AIFF, AIFF-C, AU, WAV, and VOC file formats. Unfortunately, although it can read many formats, it can only write out a handful of formats. The most prominent Windows 95 sound format that SoundApp can convert to is the WAV format. To convert a sound file, simply click the File menu heading, followed by the Convert menu item (-K). You'll be presented with a file open dialog box (see fig. 18.12).

Figure 18.12: You only use this one dialog box to convert your sound files.

Select the file you want to convert from the list of files in the dialog box. You can specify what format you want by using the Specify To drop-down list. Once you've selected the file you want to convert, click the Open button. After a little while, SoundApp returns from the conversion. A new folder in the folder of the source file is created and is called SoundApp Converted Files. In that folder, you'll find all your converted sound files from the previous directory.

Caution
Since soundapp doesn't let you specify where to save the converted file, you could easily clutter up your hard drive. If you're converting sound files all over your hard drive, each conversion creates a new folder. All these folders are called soundapp Converted Files. To reduce the number of extra folders, put all files you want to convert into one folder.

Converting Multimedia

Just as with sound files, you'll probably want to make multimedia files available in many formats. For Web authors who work for large corporations, it should be easy to re-record the data into a new format. However, many people don't have that luxury and have to convert between file formats. This has the noticable drawback that sometimes the converted file doesn't look as good as the original file. Still, for the most part, the conversions are typically very good, with little noticable quality degradation. Most of the following multimedia converters can be found at http://www.prism.uvsq.fr/public/wos/multimedia/medias.html.

SmartVid

SmartVid by Intel (see fig. 18.13) is a good Windows 95 program that lets you convert between AVI and MOV. To convert from either format to the other, click the File menu heading, followed by the Open Source (Ctrl+O) menu item. You'll be presented with a standard file open dialog box, where you indicate the file you want to convert from. You can specify the format for the source file by clicking the List Files of Type drop-down list. When you've found the file you want, click the OK button.

Figure 18.13: SmartVid by Intel for Windows 95 lets you easily convert MOV files to AVI files.

You can toggle warning messages by clicking the Options menu heading. Select either Silent or Warnings, and it controls SmartVid's behavior. Next, click the Convert menu heading, and select the Start (Ctrl+S) menu item. Once again, you'll be presented with a dialog box that lets you specify the name and type of the file you want to convert to. Clicking the OK button starts the conversion process. During the conversion process, warning messages appear, if you've enabled them. SmartVid tells you once it's done converting. You can get SmartVid at ftp://ftp.intel.com/pub/IAL/multimedia/smartv.exe.

Sparkle

Mac owners can easily convert between MPEG and QuickTime MOVies with Sparkle. This program is a combination of an MPEG and MOV player and converter. To convert between the file formats, load the file into Sparkle as if you wanted to play it. Next, click the File menu heading, followed by the Save As menu item. If you're converting to an MPEG file, you'll be presented with a dialog box (see fig. 18.14), which asks you for various MPEG information. The default values are usually fine, so you can click the OK button. Next, you'll be presented with a File Open dialog box. Specify where and under what name you want the converted file to be saved as, and click the OK button. Sparkle performs the conversion and notifies you when it's done.

Figure 18.14: To convert from QuickTime to MPEG, you need to specify some MPEG information.

Where to Find Files

If you're like most Web authors, you probably don't have a budget to create multimedia files. That doesn't mean you can't put in existing multimedia files into your Web page, however. The Net is filled with archives full of sound and multimedia files (see table 18.1). But since the Net is an ever-growing entity, it will undoubtedly get more large collections of sound and multimedia files.

Table 18.1  Sound and Multimedia Archives

URL Content
http://homepages.udayton.edu/students/ A large collection of various siefert/movies/MOVIES.HTM MPEG and MOV files
http://www.ncsa.uiuc.edu/SDG/DigitalGallery/ A large collection of DG_science_theater.html science-related animation files
http://www.uslink.net/~edgerton/index.html A collection of animation that spans various topics
http://deathstar.rutgers.edu/people/ Various scenes from bochkay/movies.html television and movies in various formats
http://tausq.resnet.cornell.edu/mmedia.htm A collection mainly of movie clips
http://users.aol.com/ojwavs/waves.com A small collection of movie samples in WAV format
http://www.io.org/~cme/ A small collection of music from Canadian bands
http://www.valleynet.com/~ericmort/dd.html A directory of original songs along with links to music samples
http://www.iuma.com/IUMA/index_graphic.html A collection of music from bands and labels around the world