home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pas_nl
/
resplay
/
resplay.doc
< prev
next >
Wrap
Text File
|
1991-02-09
|
9KB
|
229 lines
_ __ __ () _ __ _ __ _ ,
' ) ) / ` /\ ' ) ) _// / ) ' ) / Sound Sample Utility
/--' /-- / ) /--' / /--/ / / Software for the IBM
/ \ (___, /__/__ / /___ / (_ (__/_ PCs useless speaker!
//
Version 1.00 (/ (C) Mark J Cox 1990
_____________________________________________________________________________
RESPLAY is a memory resident program designed to help high-level language
programmers make the most of the PCs useless speaker. By use of some
simple procedures, you can playback samples from within your programs
and sample yourself. Playback can either be to the PC speaker (no too
bad) or to some external hardware (described later). This program is
designed as a sister to the PLAY (currently PLAY400) series - this is
a sound sampler program for VGA with lots of nice features - If you
have not yet got a copy, try getting it from the BBS mentioned near the
end of this documentation.
_____________________________________________________________________________
POSSIBLE USES OF RESPLAY
------------------------
o Arcade Games ("He's Dead Jim!" or realistic shooting noises)
o Sound Analysis (Fast Fourier Transforms/ analysing spoken words)
o Spelling Games for kids.
o Sampling your friends and making them sound silly (by changing
their speed, or by FFTs and altering their pitch!)
o The next 'Jive Bunny' single
Features
========
o Simple to call from any high or low level language
o Options for playing through Speaker or external hardware
o Total control over speed and length of samples.
o Samples can be as big as there is free memory
o Freeware (more on this later)
_____________________________________________________________________________
PUBLIC DOMAIN - FREEWARE
------------------------
Please enjoy the RESPLAY program, you can give it to anyone
and use it for anything that does not include commercial gain.
(IE you can give it away with any Freeware program you create,
but not with SHAREWARE ones - where you are asking a fee for
your program, or commercial ones)
If you want to use RESPLAY in a Shareware or Commercial package
please contact the author who will be happy to negotiate a license!
The only stipulation is that the program remains unchanged and
that it is credited in your documentation (you need not include
this documentation with your program)
Why did I make it FREEWARE (I've had a couple of offers from
software companies for this!)? Well, because I'm a student and
hate software that I have to pay for, then find it is useless or
I could have written better... Shareware is a bit better, letting
you evaluate the package - but it's still a costly business.. By
making this software totally free I hope more people will enjoy
it and use it in their programs.
______________________________________________________________________________
INSTRUCTIONS FOR USE
====================
Resplay is a memory resident program. That means that when you first
run Resplay it stores a bit of itself (only 1.5k) in memory that can
then be called by other programs run later. To use the Resplay routines
you simply have to load the register set with the values show below and
call the interrupt 2F. If you know what I am talking about, then you
should be able to program using Resplay immediately - otherwise have
a look at the example file, EXAMPLE.C. Your programming manual
for your favourite language should explain all about how to call Interrupts
and set registers - you can do it in all the Borland TURBO packages and
just about everything else I can think of. When I get time I will
produce example programs in this package for C, BASIC and PASCAL from
a variety of manufacturers.
The first thing to do is to load RESPLAY
C:\AMAZING\PROGRAMS> RESPLAY
There are four main routines that you will need to call, these are
described below:
1. Check if Installed:
Set AX to 08201h (Installation Check)
Call Interrupt 2Fh
If AX contains 7746h then RESPLAY is installed.
otherwise RESPLAY is not installed.
2. DeInstall:
Set AX to 08202h (De Installation)
Call Interrupt 2Fh
IF AX contains 1000h (Sucess) then RESPLAY was deinstalled
otherwise RESPLAY was not already installed.
To sample or to play, the first thing to be done is to send
some setup parameters to the SET UP routing
3. Setup:
Set AX to 8210h (Set Up Routine)
Set CL to 0 for PLAY mode, 1 for SAMPLE mode.
Set BL for what port/speaker to use
BL = 0 ; Use Printer Port (LPT1)
BL = 1 ; Use Printer Port (LPT2)
BL = 2 ; Use Prototype board at 0300h
BL = 3 ; Use Printer Port (Alternative LPT1)
BL = 4 ; Use internal SPEAKER
Set BH for the sample/playback speed ( divided by 250 )
(BH = 44 for 11kHz, 45 for 11.25kHz etc)
Call Interrupt 2Fh
IF AX contains 1000h (Sucess) then all was ok and has been
set up
IF AX contains 2000h (Failure) then a parameter was out
of range (CL=0,1;BL=0..4;BH=20...160)
otherwise RESPLAY is not loaded.
Then when you actually want to do the sample/playing:
4. Main:
Set AX to 8200h (Main Bit)
Set DX to the Start Segment of the sample space
Set DI to the Start Offset of the sample space
Set CX to the High word of the length
Set BX to the Low word of the length
Call Interrupt 2Fh
If AX contains 1000h (Sucess) all went ok
IF AX contains 2000h (Failure) then you have not called
setup first
otherwise RESPLAY is not loaded.
(Note length is not in Segment:Offset form it is simply a
32 bit word. 0003 3456 would be 33456 hex bytes)
Example:
--------
To Play back through the speaker at 11kHz the section of memory
starting at 4EF0:0100 for 135000 bytes (nearly 135k) then:
(Check to see if installed)
AX <- 8210 hex
BL <- 4 (speaker)
BH <- 44 (4 * 11kHz)
CL <- 0 (play)
Call Int 2F
(Make sure that it returns Sucess)
AX <- 8200 hex
DX <- 4EF0 \__start from 4ef0:0100
DI <- 0100 /
CX <- 0002 \__ 135000 bytes = 00020F58 in hex
BX <- 0F58 / cx__////\\\\__bx
Call Int 2F
_____________________________________________________________________________
WHATS THIS HARDWARE THEN?
-------------------------
By addition of a piece of hardware costing around 20 quid (to build) onto a
spare printer port you can sample your own sounds and replay them through
your hi-fi with really astonishing quality.
HOW CAN I GET A CIRCUIT DIAGRAM?
--------------------------------
For a modest sum, I will send two 3.5" (Branded) High Density disks with
the latest version of PLAY and RESPLAY together with nicely printed
instructions and a copy of the circuit diagram. To obtain this
package, send 10 pounds (sterling!) to the address at the end
of this document! I make a little profit on each, but that will help
to cover the cost of the book I had to buy to improve my VGA routines!
HOW LONG A SAMPLE CAN I STORE?
------------------------------
It depends on what frequency the sample is and how much memory is free -
at 16kHz (the speed I like to sample at) I get about 33 seconds into
memory with no TSRs except a Disk Cache - I have a mac sample at 11kHz
of the entire Dr. Who. theme tune; Sorry, until I fathom how
to use Extended/Expanded memory it can't use it!
GREAT BBS
---------
Try 'Kingdom of GREYHAWK' on Derby (0332) 756414 24hr for the latest
versions, PLAY350 the VGA interactive sampler and lots and lots of
samples - Don't forget to mention RESPLAY when registering!
(300...9600 baud)
MAIL ME?
--------
Please mail me about any bugs or future enchancements you
would like to see. Leave a message on Greyhawk BBS
(2:250/404.5 if you use NetMail)
or "mjhc8@uk.ac.bradford.eeng" from any University/Poly etc.
(Normal Post does OK too! :-)
WARRANTY
--------
There is no warranty of any kind, and the copyright owner is not
liable for damages of any kind. By using this free software,
you agree to this.
The software and documentation are:
Copyright (C) 1990
Mark J Cox
29 Lundie Close
Stenson Fields
Derby
DE2 3AN