 SOUND(1)                     SOUND(1)


 NAME
      Sound - A Sound Command for MS-DOS

   SYNOPSIS
      sound.exe [soundfile.snd]
      (see usage for other options)

   DESCRIPTION

   Sound.Exe is a FreeWare commandline utility that can play .SND files
   through the PC Speaker, or play frequency, duration pairs
   interactively or in a batch file from MS-DOS.

   It can be called from a batchfile or from the DOS commandline to
   provide a beep... or series of beeps... in different frequencies and
   of different durations...

   A Binary .SND (sound) file of frequency words followed by a duration
   bytes can be used as program input. The .SND file is named as a
   commandline argument.

   If a filename is not used as a commandline argument, other
   command line options are available. See usage.

   Sound.exe is somewhat reminiscent of the BEEP command in the
   "Classical" Norton Utilities BE (Batch Enhancer) (which is not as
   useful as it was before DOS died).

   Sound.exe works similarily to the GWBASIC SOUND statement when used
   to play frequency, duration pairs from the command line or in a batch
   file.

   Sound.Exe is not "seriously" useful and was written as a DEMO Program
   for the Snd2midi.Exe application.

 USAGE

   Usage: sound [sound.snd]

   *or* alternately

   Command Usage can be of the following forms

   Usage 1: sound
            a short beep
   Usage 2: sound [frequency]
            a short beep in a "certain" frequenecy
   Usage 3: sound [frequency] [duration]
            a beep in a "certain" frequency for a "certain" duration
   Usage 4: sound [freq1] [dur1] [freq2] [dur2]...
            beeps of "certain" frequencies for "certain" durations
            (a series of frequency duration pairs)


 SOUNDFILE

      .SND File Format

      The soundfile used by sound.exe is an "Old Style" PC Speaker .SND
      file used by the author's programs (like WorkBook and Mickiano) to
      play a simple melody through the PC speaker

      The .SND File Format is a binary file of 3 byte "sound packets".
      Each packet is a frequency, duration pair. The frequency is in the
      form of a 2-byte Intel Word. The duration is in the form of a 1
      byte unsigned char.

      The end of file is marked with 2 bytes...
      0ffh, 0ffh (frequency = -1).

      The Frequency is in hertz. Silence is encoded as 32767.

      The Duration is in PC Timer Ticks (interrupt 1Ch), of 18.2 per
      second. Maximum duration is 255 ticks (approx. 14 seconds), which
      is more than enough time to sustain a single sound on a PC
      speaker without experiencing extreme pain and discomfort.

      As a matter of fact, some serious minded users of that era were
      known to become quite agitated after repeated audible assaults of
      this nature, and to permanently disassemble their PC speaker
      apparatus, sometimes in a violent manner. Nevertheless...

      The .SND file format pretty much matches the GWBASIC SOUND
      Statement, which is long established as one of the two standard
      methods to play monophonic music on the PC Speaker (The other way
      was using the GWBASIC PLAY Statement, which was a "macro" language
      and couldn't be easily used in other programming languages besides
      GWBASIC).

      i.e. GWBASIC defined the SOUND statement as follows:

      SOUND frequency, duration

      Generates a sound through your computer's speaker.

      frequency - The frequency of the sound in hertz; a value in the
      range 37 through 32,767.

      duration - The number of system clock ticks the sound lasts; a
      value in the range 0 through 65,535. There are 18.2 clock ticks
      per second.

      At any rate, before sound cards were popular, this was the usual
      way to play sound on the PC speaker, so this is why I encoded my
      music in the .SND file format. (The 3 byte packet was used to save
      disk space, which was also at a premium at that time.)

 AUTHOR

      Bill Buckels <bbuckels@escape.ca>
      http://www.escape.ca/~bbuckels

