Audio Formats, etc.

    First, some basic information about audio and its application on the Web.  The ability to provide high quality spoken voice and music has been available to the webmaster since nearly the beginning of the Internet.  Despite this availability, there are some serious drawbacks to audio on the web.  In order to provide the highest quality possible, we have to understand our users capabilities.  We must understand that not all users will have the high-speed, high-end computers that we use in the labs.  To provide the highest quality available, we must provide it to the cheapest computer system out there.  This involves huge files and lots of bandwidth to deliver.  Fortunately, there are compression schemes out there to help us begin to address this problem.  My favorite, you should know by now, is RealAudio.  But, later for that one.
    There are a lot of texts that deal with the intricacies of digital audio.  Suffice it to say that digital audio, sample rates and resolution, is analogous to color-depth and dpi for graphics.  What is important to understand is the files types.  Before we begin, lets talk about MIME.  MIME stands for Multipurpose Internet Mail Extensions.  MIME was originally established to send multimedia via email.  This included graphics, audio and video.  Web servers must be set up to handle different MIME types.  Every document, graphic or multimedia file has a MIME type and sub-type.  An example of a MIME type is "text."  A sub-type could be "plain."  You might have confronted this when looking at HTML source codes.  It appears as "text/plain" or "text/html."  A GIF file has the type "image/gif"  This is all necessary for browsers to process requests for information.  When a browser requests a file called "picture.gif", the web server looks up the file extension in its MIME type table.  The MIME table establishes this file as a "gif" and sends that information to your browser that in turn determines the appropriate action to take, such as displaying the image in-line or launching a Plug-in.  After all that, what is really important is to understand that to deliver multimedia content, you must understand file types and extensions and how they are handled by your server.
    OK, so now about those formats.  The first one you may encounter is ".au".  This format is standard on Sun computer systems.  They provide adequate sound of lower quality than other formats.  These formats are still very common on the 'net due to the fact that they are UNIX based.  The next format is AIFF (Audio Interchange File Format).  This format is common on MAC's and generally has good quality.  QuickTime is Apple's cross-platform multimedia format for audio-only movies.  These files have the ".mov" extension.  Next is ".wav" format.  This is the native format for Windows.  It is either 8 or 16-bit audio and provides good quality sound.  From your desktop begin Start-up - Programs - Accessories - Multimedia, you will find the Sound Recorder that is native to Windows.  Here's an example.
Be sure you check out all the menu functions for Sound Recorder, especially File - Audio Properties.  We need to discuss, specifically, the preferred quality.  Look at the file size of your recorded ".wav" file.   Does it change by changing the audio quality?  Try it.  How is this important to your user?
    Now let's put this audio on our webpage.  If you are using Netscape Composer, make it a link.  We all know how to do this by now.  The html code for my previous example is:
            <A HREF="audiolec1.wav">Here's an example.</A>
To embed our sound to begin after the page has loaded, we will need to use the html tag like this:
            <embed src="audiolec1.wav" autostart = true  hidden = true>
The "autostart" attribute will start the page immediately on loading and the "hidden" attribute wil hide the controller console.  The attribute value of "true" is the same as yes.  Remember, we are still in a binary world.  Take some time now to try it.  What are some applications for using the ".wav" format?  What are your limitations?  What will the following html code produce:
            <embed src="xfiles.mid" Autostart=TRUE width=145 height=60 loop=true>

NOW!  On to midi.  MIDI (Musical Instrument Digital Interface) is the standard serial communications protocol used to exchange data between synthesizers, computers, software programs, effects processors, and other devices.  MIDI data only consists of performance data.  What midi does not contain is sampled digital waveform data.  This makes midi very compact.  To playback midi data requires a synthesizer.  Midi is a great way ro provide music data on the web and is supported by most browsers and platforms.  Playback is dependent on setup and available sounds on the user's machine.  There are three types of midi formats:
 
                General MIDI is a standard set of patches that assures midi authors of certain configuations, e.g. consistent playback and a minimum of 16 channels

                Standard MIDI (SMF) is a standard format that MIDI sequencers and editors can use to share files.  There are two types of SMF:  type zero combines all data into one track, and type one assigns each MIDI channel to a separate track.

                MOD files are typically used on Amiga computers.  They require helper apps.  The audio samples are save in RAM before playback.

There are literally hundreds of thousands of websites out there that are excellent resources for midi data.  Here is a great source for Public Domain midi files:

                http://files.midifarm.com/midifiles/General_MIDI/

Here's an example: A little ivory-tickling from Chopin!   Or,  One of Bach's last works.   Playback qualities may be different due to the way your individual machine handles midi.  Now you try downloading some midi files and putting them on your homepage.  Sound cards are available for computers that have built-in synthesizers.  Some have input and output ports to connect directly to outboard synths.  MIME type is audio and MIME subtype is midi, file extensions are .mid or .midi.   To serve up MIDI files has hyperlinks:

                <a href="sound.mid">My midi sound! </a>

To embed midi (Netscape 2 or later):

                <embed src="sound.mid" autostart = true  hidden = true>
OR
To embed midi controlled by the user:

                <embed src="sound.mid" height = 15  width = 144 controls = smallconsole>

To embed midi sounds in Internet Explorer (only) as background:

                <bgsound src="sound.mid">

Remember to embed midi files for both common browsers, Navigator and Explorer.  Tags not recognized by a browser are ignored.  NOW, try it!