DR. WEBSITE

Where to Find Java Code for Sound Files; DOCTYPE Tags Tell SGML Tools of HTML Version

By Dr. Website

Dear Dr. Website®: I'd like to use Java to offer sound clips and music programming on my site. Where can I find ready-to-order Java code that will let users play back sound files? You'll find a good number of sound-related Java applets to choose from at online Java resources like Gamelan and JARS.com. Some are offered as examples of how you can create a virtual jukebox with Java, while others have educational purposes, such as applets that teach you how to recognize guitar chords.

For your purposes, you'll want to look for applets that come complete with source code and with licensing terms you can meet. For example, Audio Player by Bhagvan Kommadi is one standalone Java application that will play .AU sound files.

The ClipControl Applet by Steve Kinzler also offers a way you might use Java to provide a Web interface for sound clip archives. It displays three buttons--play, loop, and stop--for controlling the sound file loaded when this applet is called. The applet also has a built-in Load button that lets you load additional sound clips from the applet itself instead of having links to them on your Web page. The ClipControl Applet page gives examples using sound clips from the "Schoolhouse Rock" educational cartoons from the 1970s.

What's Up With doctype?

Dear Dr. Website®: In looking at the source code for some of my favorite Web sites, I've found that a couple of them begin with a line that looks something like this: <!DOCTYPE HTML PUBLIC"//IETF//DTD HTML 2.0//EN"> What does this mean? As you may know, HTML is a subset of SGML (Standardized General Markup Language), a generalized language for defining other programming language.

This line of code is an example of a DOCTYPE declaration, which SGML tools use to determine the version of HTML used in the document. In order to adhere strictly to HTML guidelines, you should include a <!DOCTYPE> tag before the opening <HTML> tag in your Web documents.

The DOCTYPE line in the example you cite indicates the document should adhere to the HTML 2.0 standards. Similarly, you might see DOCTYPE declarations that a document is HTML 3.0- or 3.2-compliant.

If you make use of proprietary HTML elements that are not part of the HTML standards, you can use a non-standard <!DOCTYPE> tag like: <!DOCTYPE HTML PUBLIC "//WebTechs//DTD Mozilla HTML//EN"> You might be interested to know that very strict HTML validation tools--like A Kinder, Gentler Validator, for example --will return errors if your HTML documents do not start with a <!DOCTYPE> tag. Further, the HTML standards specify that if no <!DOCTYPE> is specified, the HTML 2.0 standard should be considered the default level of compliance by which the document should be judged.

More details about the anatomy of SGML documents can be found in the comp.text.sgml FAQ.

Navigator and MSIE, Tag by Tag

Dear Dr. Website®: Are there any good resources to turn to for identifying when different HTML features were first supported by Netscape Navigator and Microsoft Internet Explorer? One such resource that might prove useful to you in identifying when the leading browsers began to support various HTML features is the Index Dot Html site.

This practical guide provides a comprehensive table of the HTML tags supported by Internet Explorer, NCSA Mosaic, and Navigator. The alphabetical tag listings also note the version of each browser where the vendor added support for that tag. Each HTML tag has its own page that lists browser support, a brief description, all attributes of the tag and what values are permissible, tag examples, and tips and tricks for usage.

The site also offers brief overviews of HTML 2.0, 3.0, and 3.2, but the emphasis is on comparing tags and features in these popular browsers, along with an extensive reference on specifications for style sheets.



Reprinted from Web Week, Volume 3, Issue 12, April 28, 1997 © internet.com Corporation All rights reserved. Keywords: html java Date: 19970428

http://www.internet.com