home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / C / SOUND / README < prev    next >
Text File  |  1993-12-01  |  6KB  |  114 lines

  1.                                    Speak
  2.                             Copyright (C) 1991
  3.                             All Rights Reserved
  4.                              David S. Hoelzer
  5.  
  6.     First we'll get the business done:  PLEASE READ THIS!!!!
  7.  
  8.     This program is hereby released into the public domain.  You may use
  9. and distribute this object library as you wish under the following restrictions:
  10.  
  11.     1) You may NOT distribute altered copies of this library!  Under NO
  12. circumstances!  If you think that you have a decent mod for it, contact me at
  13. one of the addresses below and we'll talk about it.
  14.  
  15.     2) You may NOT distribute anything that you write using this library
  16. as shareware or commercial software unless you contact me FIRST!!!  If I find
  17. something out there with my code in it, believe me, I'll know.  Please feel 
  18. free to write PUBLIC DOMAIN software with this library.  Anything that you do
  19. write that uses this code MUST mention in a VISIBLE place that this code was
  20. used and where the end user might obtain a copy for himself.
  21.  
  22.     3) If you want the source code, you MUST contact me.  I will distribute
  23. the source code to you for a small fee.  You will also be notified of any
  24. updates.
  25.  
  26.     Now to the library:
  27.  
  28.     This object library SHOULD be able to play nearly any sound file that
  29. is PCM encoded.  This includes a great many sound file formats.  VOC files,
  30. SND, IFF, etc, etc...  To use the function, you must (obviously) link the 
  31. appropriate OBJ file into your program.  See the demo mak and prj files for
  32. examples on how to do this.  To keep your compiler happy, you should also
  33. include the following function declaration in your code:
  34.  
  35. void SOUNDPLAY(char *, char, int);
  36.  
  37.     The arguments are as follows:
  38.  
  39.     char * = an null terminated string up to 30 characters containing
  40.         the path and filename.  The path is NOT necessary if the
  41.         sound file is in the current directory(recommended).
  42.  
  43.     char   = Twiddle byte.  Different file formats store the data with
  44.         different minimum and maximum values.  These values usually
  45.         range from 0 to 255 or from -127 to 128.  Even so, since we
  46.         are using a lowly PC speaker, you will find that different
  47.         values work better for different files.  You can experiment
  48.         with the SPLAY.EXE program contained in this Zip file.
  49.  
  50.     int    = This integer is used to slow down or speed up the rate
  51.         at which the sample is played.  I wasnt in the mood to
  52.         figger out how to convert sample speed to this number,
  53.         so yer stuck with it for now.  The higher the number,
  54.         the slower the speed.  Pass a 0 or negative values at your own
  55.         risk!!  You will listen to a bunch of clicks for a LONG time.
  56.         You have been warned.
  57.  
  58.     It is important to realize that this program was developed on a 6
  59. MHz AT.  Why is this important??  Well, if you want to play something on
  60. an XT or PC with a slower clock speed, yer gonna have to have a much lower
  61. delay speed.  This will also tend to affect what value you should use to
  62. twiddle your file.  There are reasons for this.  If you want to know, take out
  63. a book on PCM and PWM coding like I did.  Generally, if you change your speed
  64. buy 5, your twiddle will change by 10.  Up or down depends on the type of file
  65. and what your twiddle value already is.  Using SPLAY on a 4.77 MHz 8088 sitting
  66. next to me, for the file Coffee.voc, I need a delay of 5 and a twiddle of 180
  67. to get a decent sound.  On this AT I can get a decent sound for this same file
  68. with a delay of 15 and a twiddle of 180.  Setting the 8088 into 10 MHz Turbo
  69. (Blastin!!) mode, I can use the same values as the AT and get a decent sound
  70. reproduction.  One way to program around the machine is the write a simple
  71. function to figger out how fast the machine is.  With that information, you can
  72. alter the delay speed.  Generally, if you find the proper speed on a machine,
  73. the twiddle will remain the same as it would for all machines.  The only time
  74. you need to worry about changing it is when you are first finding the optimal
  75. twiddle for whatever it is you want to play.
  76.  
  77.     If you pass the program a file that it cannot find, it will print
  78. a very pleasant File not found message..  I just realized that I probably
  79. should have designed it to return an int for success, but, heck, it's too
  80. late now.  Maybe next time.
  81.  
  82. IMPORTANT NOTES ON LINKING!!!!!
  83. -------------------------------
  84.     While writing this program I discovered that Quick C has it's own
  85. sick way of passing values to functions.  It doesnt seem to use the standard
  86. push the values on from right to left that every other C compiler uses.  For
  87. this reason there are two obj files included in this release.  SPEAKTC.OBJ
  88. and SPEAKQC.OBJ, for Quick C and Turbo C & C++.  I did not have a copy of
  89. Microsoft C available to test this program with.  I would assume that MSC
  90. uses more conventional methods for passing parameters, so SPEAKTC.OBJ 
  91. should work with it.  If not, try SPEAKQC.OBJ.  If both of these fail, PLEASE
  92. contact me!  I will find someone with a newish version of MSC and work it out
  93. for that compiler.  I think that you will find the SPEAKTC.OBJ will work with
  94. nearly any compile, though.  This OBJ's are compiled for SMALL MEMORY MODELS!
  95. Please keep this in mind.  Again, if you need it compiled in something else,
  96. either write me for the source code or convince me to recompile it for you.
  97.  
  98.  
  99. Have fun folks.  I can be reached at:
  100.  
  101. dhoelzer@gnu.ai.mit.edu
  102.  
  103. David Hoelzer
  104. 205 Oakland Avenue
  105. Central Islip, NY  11722
  106.  
  107. David Hoelzer
  108. c/o
  109. Everest Systems
  110. Suite 180
  111. 16 Campus Plaza
  112. Box 2000
  113. Vestal, NY  13850
  114.