Contents of the SPKR.DOC file
This program demonstrates a technique for playing digitized sound through
the speaker on faster 286's or 386's. This method employs pulse width
modulation at 16KHz to produce the equivalent of 6-bit resolution.
Basically, the system timer interrupt is taken over and speeded up
to 16KHz, rather than the normal 18.2 Hz. At each interrupt, the next
sound sample (scaled to a range of 0-72) is used as the duty cycle for
the speaker timer, i.e., the amount of time the output stays high between
interrupts. Low-pass filtering by the ear is mainly responsible for
reconstruction of the original signal. This technique is equivalent to
that being employed in "many times" over-sampling systems, where it is
cheaper to use very high speed 1-bit DACs and low pass filter the output,
rather than using costly high-resolution DACs at lower rates.
Sound input to the program is assumed to be in Turtle Beach SampleVision
format, though it would be fairly easy to substitute another source.
The program expects one command line parameter, which is the name of
the SampleVision file. Rate conversion to 16KHz is done assuming the
nearest 8KHz increment in the sampling range 8KHz to 48KHz.
There is currently a problem which has yet to be satisfactorily
resolved. Occasionally a high-pitched shrill will be heard over the
sound. This appears to related to the initialization sequence of the
programmable interval timer. In general, however, the sound quality
is very intelligible, especially for voice. Note that unless the
original signal is highly compressed, the low sound level of the pc
speaker will result in very soft output. In fact, pushing the sample
level beyond clipping may actually help in some cases. (Remember, this
is meant to be merely functional, not audiophile quality). Good Luck!