home *** CD-ROM | disk | FTP | other *** search
- Speak
- Copyright (C) 1991
- All Rights Reserved
- David S. Hoelzer
-
- First we'll get the business done: PLEASE READ THIS!!!!
-
- This program is hereby released into the public domain. You may use
- and distribute this object library as you wish under the following restrictions:
-
- 1) You may NOT distribute altered copies of this library! Under NO
- circumstances! If you think that you have a decent mod for it, contact me at
- one of the addresses below and we'll talk about it.
-
- 2) You may NOT distribute anything that you write using this library
- as shareware or commercial software unless you contact me FIRST!!! If I find
- something out there with my code in it, believe me, I'll know. Please feel
- free to write PUBLIC DOMAIN software with this library. Anything that you do
- write that uses this code MUST mention in a VISIBLE place that this code was
- used and where the end user might obtain a copy for himself.
-
- 3) If you want the source code, you MUST contact me. I will distribute
- the source code to you for a small fee. You will also be notified of any
- updates.
-
- Now to the library:
-
- This object library SHOULD be able to play nearly any sound file that
- is PCM encoded. This includes a great many sound file formats. VOC files,
- SND, IFF, etc, etc... To use the function, you must (obviously) link the
- appropriate OBJ file into your program. See the demo mak and prj files for
- examples on how to do this. To keep your compiler happy, you should also
- include the following function declaration in your code:
-
- void SOUNDPLAY(char *, char, int);
-
- The arguments are as follows:
-
- char * = an null terminated string up to 30 characters containing
- the path and filename. The path is NOT necessary if the
- sound file is in the current directory(recommended).
-
- char = Twiddle byte. Different file formats store the data with
- different minimum and maximum values. These values usually
- range from 0 to 255 or from -127 to 128. Even so, since we
- are using a lowly PC speaker, you will find that different
- values work better for different files. You can experiment
- with the SPLAY.EXE program contained in this Zip file.
-
- int = This integer is used to slow down or speed up the rate
- at which the sample is played. I wasnt in the mood to
- figger out how to convert sample speed to this number,
- so yer stuck with it for now. The higher the number,
- the slower the speed. Pass a 0 or negative values at your own
- risk!! You will listen to a bunch of clicks for a LONG time.
- You have been warned.
-
- It is important to realize that this program was developed on a 6
- MHz AT. Why is this important?? Well, if you want to play something on
- an XT or PC with a slower clock speed, yer gonna have to have a much lower
- delay speed. This will also tend to affect what value you should use to
- twiddle your file. There are reasons for this. If you want to know, take out
- a book on PCM and PWM coding like I did. Generally, if you change your speed
- buy 5, your twiddle will change by 10. Up or down depends on the type of file
- and what your twiddle value already is. Using SPLAY on a 4.77 MHz 8088 sitting
- next to me, for the file Coffee.voc, I need a delay of 5 and a twiddle of 180
- to get a decent sound. On this AT I can get a decent sound for this same file
- with a delay of 15 and a twiddle of 180. Setting the 8088 into 10 MHz Turbo
- (Blastin!!) mode, I can use the same values as the AT and get a decent sound
- reproduction. One way to program around the machine is the write a simple
- function to figger out how fast the machine is. With that information, you can
- alter the delay speed. Generally, if you find the proper speed on a machine,
- the twiddle will remain the same as it would for all machines. The only time
- you need to worry about changing it is when you are first finding the optimal
- twiddle for whatever it is you want to play.
-
- If you pass the program a file that it cannot find, it will print
- a very pleasant File not found message.. I just realized that I probably
- should have designed it to return an int for success, but, heck, it's too
- late now. Maybe next time.
-
- IMPORTANT NOTES ON LINKING!!!!!
- -------------------------------
- While writing this program I discovered that Quick C has it's own
- sick way of passing values to functions. It doesnt seem to use the standard
- push the values on from right to left that every other C compiler uses. For
- this reason there are two obj files included in this release. SPEAKTC.OBJ
- and SPEAKQC.OBJ, for Quick C and Turbo C & C++. I did not have a copy of
- Microsoft C available to test this program with. I would assume that MSC
- uses more conventional methods for passing parameters, so SPEAKTC.OBJ
- should work with it. If not, try SPEAKQC.OBJ. If both of these fail, PLEASE
- contact me! I will find someone with a newish version of MSC and work it out
- for that compiler. I think that you will find the SPEAKTC.OBJ will work with
- nearly any compile, though. This OBJ's are compiled for SMALL MEMORY MODELS!
- Please keep this in mind. Again, if you need it compiled in something else,
- either write me for the source code or convince me to recompile it for you.
-
-
- Have fun folks. I can be reached at:
-
- dhoelzer@gnu.ai.mit.edu
-
- David Hoelzer
- 205 Oakland Avenue
- Central Islip, NY 11722
-
- David Hoelzer
- c/o
- Everest Systems
- Suite 180
- 16 Campus Plaza
- Box 2000
- Vestal, NY 13850
-