home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio 4.94 - Over 11,000 Files
/
audio-11000.iso
/
msdos
/
sndbords
/
proaudio
/
mvdoc
/
tpcm.doc
< prev
next >
Wrap
Text File
|
1993-03-09
|
19KB
|
556 lines
TPCM - Test PCM
Syntax
tpcm [-T] [-dqmL] [-iname] [-r#l#s] [-v#p#c#] [-B#D#] [-R#] file ...
Options
-T output on Thunderboard (requires "set BLASTER="
-d debug mode, output status
-q quiet mode (no sound)
-m toggle use Monochrome Screen Buffer for DMA
-L Loop sound continuously
-iname name= name of input PCM file (use -r#, -l# and -s)
-r# #= default samplerate (decimal) default: 11025
-l# #= size of sample in bits (decimal) default: 8
-s treat as stereo (default: mono)
-w# #= delay in clock ticks before timing-out; default: 4
-R[X] record mode, X= compression method; default: none
-t# #= number of clock ticks to specify recording-time
-v[#] #= video display image # (1-3, see ref) default: 1
-p# #= palette # (1-8) default: 2 (6 if -v2 specified)
-c# #= palette cycle delay (default: 1)
-B# #= DMA Buffer size (KB), default: 8K if video, else 16K
-D# #= number of DMA Divisions, default: 4 if video, else 8
wavfiles ... filenames to play (overrides -R and -s)
Note: -iname and "wavfiles ..." are mutually exclusive
-b### ###= base port address for PAS (for multiple boards)
Examples
Playback
C:> tpcm sound.wav
This simply plays the file "sound.wav".
C:> tpcm -T sound.wav
This plays the file "sound.wav" on the ThunderBoard
(SoundBlaster) DAC.
The "pcm.com" driver looks for "BLASTER=" in the
environment to configure for the SB.
C:> tpcm -v sound.wav
This displays and plays the file "sound.wav".
C:> tpcm -v *.wav
This displays and plays all .wav files.
C:> tpcm -vp7c600 *.wav
This displays and plays all .wav files using palette 7
with a delay of "600" (computer speed dependent).
C:> tpcm -isound.snd -R22050 -s
This plays the PCM file "sound.snd" at 22050Hz in stereo.
C:> tpcm -vm *.wav
This displays and plays all sound files, but uses
the monochrome screen memory for the DMA buffer.
Recording
C:> tpcm -R x.wav
This records into the file "x.wav" at 11025Hz, 8-bit mono.
C:> tpcm -v -R -r44100 -s -l16 cdqualty.wav
This records into the file "cdqualty.wav" at 44100Hz,
16-bit stereo, while displaying the waveform.
C:> tpcm -RA -r44100sl16 cdqualty.cmp
This records into the file "cdqualty.cmp" at 44100Hz,
16-bit stereo, but compresses using the ALAW method.
Playback Control
During playback of the waveform, several keys are processed:
w wait for keypress, loops on DMA buffer
Not particularly glamorous, but can be irritating to those
around you.
<> slow/speed playback rate
Use this key to slowdown/speedup the playback/record rate.
m display "mark", ticks/bytes/samples
Use this key to display the current offset into the playback/
record buffer.
l turn on/off "looping" at end of file
Display Control
During display of the waveform, several keys are processed:
P palette select - the program waits for either:
0= no palette, 1 through 8= palettes 1 through 8
c,C auto cycle delay (+1/10), increasing delay as you hold key
r reverse cycle, c,C now decreases delay as you hold key
SPACE stop cycling
f,F manually cycle one way (256/16 colors)
b,B manually cycle the other (256/16 colors)
u,d change RGB up/down 1
U,D change RGB up/down 10
CR restore palette
ESC exit
Operation
This program no longer requires the TSR pcm.com to be loaded in memory.
Instead, the program will load "pcm.com" it if it is not already so found.
This requires only that "pcm.com" be found in the "PATH" (tpcm.exe and
pcm.com should be in the same directory: "\bin" or "\util").
Use this program to play .wav files, and display them in real time.
The program will accept compressed 16-bit .wav files (see "cmpwav.exe").
The program will also record using the compression methods
in "cmpwav.exe" format, although not all are real-time.
Use this program to manually specify many parameters, such as the
location and size of the DMA buffer, samplerate and datasize, IRQ
activity, and others during the playback or record.
Options
As you can see, there are many options available to affect the startup
conditions of the program.
-T
Use the -T option to output the sound on the SB part of the PAS, or
on a ThunderBoard, or on a Sound Blaster.
You must set the variable "BLASTER" in the environment before pcm.com
loads and before running tpcm.exe. The following defines the meaning
of this variable:
C:> set BLASTER=A220 D1 I5 T3
| | | || || ||
| | | || || `--- Product Number "3"
| | | || `------ IRQ Number "5"
| | | `-w-------- DMA Channel "1"
| `-------------- Port Address "220h"
`------------------- Variable Name "BLASTER"
-d
Use the -d option to observe the queueing of data and the waiting for
DMA to finish. When redirecting this output to a file on a ramdrive,
you can see how much time there is available for additional processing.
Use this option when attempting to locate valid DMA/IRQ combinations.
Display and Sound Output from the program will help you determine valid
combinations. This is useful with the "proas.exe" program, which will
reprogram the card to any dma/irq combination.
-q
Use the -q option to suppress the output of sound and have the program
simply run through the file. Note that there will be no display (if the
-v option was specified) as there is no DMA activity and so no User
Function calls. Use the -d option to see the progress of loading the
file and the associated simulated DMA transfers.
-m
Use the -m option to cause the program to use monochrome screen memory
for the DMA buffer. Note: this memory may be used as DOS UMB (loadhigh),
and overwriting this area with sound data is not suggested! However, if
you do have a monochrome monitor, then you can watch the data slam by.
Why use the monochrome screen buffer for DMA? Well, nowadays,
with VGA and multi-megabyte-memory machines, the B segment is
a nice 32K block of memory commonly unused, and perfect for
scratch memory (like sound, where overwrites are merely noisy,
not fatal).
Unfortunately, this memory is too slow for use with 44,100 Hz
sounds, so this is not a perfect solution. Also, some machines
generate a high-frequency pitch when accessing this memory
during DMA transfers.
-L
Use the -L option to loop on the sound file continuously. Press ESCAPE
to exit the loop and proceed to the next file (if any).
Use this option with the 'm' key to display the current timeticks/bytes/
samples of playback or record. This gives you the ability to jot notes
on paper of where interesting clips occur in a sound file.
While looping, you can press the "<>" keys (or ",.") to
slowdown or speedup the samplerate, and so achieve a
higher degree of resolution when specifying "marks".
-i
Use the -i option to specify a filename (no DOS wildcards allowed).
Use the -s, -l and -r options to specify stereo, the sample size in bits,
and the sample rate.
-r
Use the -r option to specify the samplerate for .wav files specified
with the -i option, and for non .wav files, and for recording. This
value can range from 4000 to 88200 for mono files, and 8000 to 44100
for stereo files.
-l
Use the -l option to specify the bit-size of the ram data samples.
Use this option when processing sound files or by using the "-i" option.
-s
Use the -s option to cause the program to treat the -i specified file or
raw PCM files as stereo. This option has no effect on files whose
formats are known, unless the file is specified using the -i option.
-v
Use the -v option to select a picture to display:
1 tpcm.scr 256-color gradient
2 tpcm2.scr me
3 tpcm3.scr lame-looking "deck" with useless knobs
These must be simple "memory dump" files, 320x200x8bit.
-B
Use the -B option to specify the size of the DMA buffer in KB. This
number is expressed in decimal, and should be either 4, 8, 16, 32 or 64.
This number is forced to at least 4, unless the -v option is given, in
which case it is made to be 4 for stereo output, and 2 for mono.
This number usually specifies the DMA buffer size in KB, but if the value
given is greater than 64, then it specifies the actual buffer size.
To get a 1-second DMA buffer with a 22050Hz, 16-bit mono
sound, use "-B44100".
-D
Use the -D option to specify the number of parititions for the DMA buffer.
This number is expressed in decimal, and should be a power of 2 greater
than 1. If the -V option is given, then it is made to be 2 in order to
ensure synchronous sound and display output.
The DMA buffer routines in pcm.com accept buffer sizes that
are not multiples of 1024, and recognize treat any passed
size that is greater than 0xFF to be the size in bytes
instead of Kbytes). Thus -B15750 is valid.
Also, pcm.com handles number-of-divisions of the DMA buffer
that are not powers of 2. Thus, -D5 is valid.
Note that the size of the DMA buffer should be a multiple
of the number of divisions to prevent buffer overruns.
Mono/Stereo display is selected automatically according to the channels
for recognized .wav files.
You can specify multiple files to process, if the -i option is not also
used, by naming them at the end of the command line. You can use DOS
wildcards: "tpcm *.wav". These files are examined to determine their
type, and .wav files have their format information used to specify the
number of channels and samplerate, but the command line parameters or
default values are used for non-.wav files.
Record Mode
Use the -R to put the program into "record" mode.
Most options are valid in this mode, with exception of -l (looping) and
-iname ("input file name"), and that only one filename is processed.
The program will attempt to compress in real-time using the format
specified with the -R option:
-RA - use ALAW
-RM - use MULAW
-RI - use IMA
-RW - use Microsoft ADPCM (not real-time - but implemented).
-RP - no compression
This output format is compatible with the input, so you can always use
tpcm to play/record these files, and "cmpwav.exe" (from MediaVision) to
control their format.
Return Value
Playback
errorlevel 0 if the file played with no error.
errorlevel 1 if the file played but not properly (IRQ mismatch)
errorlevel 255 if it failed to find or load the pcm.com TSR.
other nonzero errorlevel for syntax error, bad memory, etc.
Record
errorlevel 0 if the file recorded with no error.
other nonzero errorlevel for syntax error, bad memory, etc.
Requirements
MediaVision Pro Audio Spectrum (any model).
This program requires a graphics monitor with the ability to display
320x200x256 colors in order to display the waveform.
Secrets
DMA Buffer Location
It is possible to specify the location of the DMA buffer manually using
two options not documented above, however, this can be very dangerous.
Use the -S# and -O# options to specify the segment and offset (in hex)
of the DMA buffer (use the -B# and -D# option to specify the size and
divisions). You can then have the program play or record and direct
the DMA buffer to A000:0, thus seeing the PCM data appear on the
screen in graphics mode. Interesting? Maybe, but since we can, why not?
If you have the "setdma.exe" and "freedma.exe" programs,
you can use them to allocate and deallocate a 16K block of
memory from the very top (thereby eliminating any waste).
The "setdma.exe" program displays the segment to specify
with the tpcm -S option (and to "freedma.exe").
The -S and -O options ask you to confirm that you are manually
specifying these values to prevent accidental confusion with
the -s and -o options, unless you insert a "!" between the "S"
or "O", as in "-S!####" or "-O!####".
Using monochrome screen memory as the DMA buffer can be "noisy".
Multiple PAS Boards
Also, you can specify a "Board Address" to gain access to multiple
PAS boards by using "-b###". Each board requires an instance of
"pcm.com" or "pcmfun.com" loaded with the same board address.
"tpcm.exe" will use the first available pcm.com (pcmfun.com) if no
particular board address is specified. If an address is given, then
the first pcm.com (pcmfun.com) that controls that board will be used.
If no suitable handler is found, then the program will install "pcm.com"
for that particular board address. The default address is 388h, but
the TSR will locate at the first found address.
The following sequence will demonstrate the logic implemented:
C:> proas -b388 d:5 q:15 s:1,220,1,5 v:70
C:> proas -b384 d:6 q:11 s:1,230,3,7 v:70
These two lines initialize two PAS16 boards,
one at 384h, one at 388h
C:> tpcm sound.wav # no handler, load pcm.com at 388h
With no handler installed, the program loads pcm.com,
and with no board address specified, the default is 388h.
C:> tpcm -b384h sound.wav # no handler, load pcm.com at 384h
With no handler installed for the particular address,
pcm.com is loaded for that particular board.
C:> pcm -b384 -i # install handler for board 384h
When a handler is installed, that board is the default
board when no address is specified.
C:> tpcm sound.wav # is handler, plays on board 384h
With a handler installed, and no board address specified,
the sound is played on that handler's board.
C:> tpcm -b388 sound.wav # no handler, load pcm.com at 388h
A handler is installed, but not for the specified board,
so pcm.com is loaded and the sound plays on that board.
C:> pcm -b384 -u # uninstall handler for board 384h
C:> pcm -b388 -i # install handler for board 388h
The default board to play on when no address is specified
was 384h, and is now 388h.
C:> tpcm sound.wav # is handler, plays on board 388h
No address specified, plays on first handler's board.
C:> tpcm -b384 sound.wav # no handler, load pcm.com at 384h
No handler for that board installed, so pcm.com is
loaded and the sound is output on that board.
C:> pcm -b384 -i # install handler for board 384h
Now there are two handlers installed, one for each board
C:> tpcm sound.wav # play on first found (384h PAS)
The first handler found (is the last one loaded) is at
at 384h, so since no address is specified, output comes
out of the board at 384h.
C:> tpcm -b384 -T sblast.wav # play sound on board 384h TB
Address specified, and handler exists.
C:> proas -b380 d:7 q:12 s:1,220,0,3
C:> pcm -b380 -i
Uh, oh, another board is initialized, at 380h, and
a handler is installed for it.
Since this is the last handler, it is the first
found, and so is the default board when no address
is specified.
C:> tpcm sound.wav
No address specified, output on 380h.
With "srs.exe", you can use the 'm' Mark valuse to cut sounds clips
into other files, and then add them together to create a new sound
track, all from the command line.
C:> tpcm -L sound.wav
... during playback, slow samplerate using "<" ...
... during loopback, press the 'm' key to display
... ticks/bytes/samples offset at desired points ...
C:> srs save from sound.wav at 44376 upto 83000 into sound.0
... 44376 is the byte offset to start cutting ...
... 83000 is the byte offset of the end of the cut ...
C:> tpcm -L sound.0
... loop on the cut clip ...
C:> srs add sound.0 into soundtrk.wav at 10 secs save
... add the sound clip into the sound track being edited ...
New Stuff
-T, the Thunder Board (Sound Blaster) output.
"<>" during playback.
pcmfun.com interface.
multiple boards.
Programmer Output
dasj;l;kare-0423m saldf, 3129;as,.4pdfp
I did that!
Whew! If you are reading this, then you are my kind of user!
I feel like I can tell you things... things I haven't told anyone else!
Except for everyone who will listen, that is!
Seriously (why do I keep backspacing and undoing, instead of just
getting on with it!). (Okay, so I just finished the "copyright" stuff
below... talk about conjuctive phrasing!)
Okay, so what I really want to say is, if you have gotten this far,
don't stop now!
First, a little about the programmer of this stuff. Me. SRS.EXE,
PCM.COM and PCMFUN.COM, TPCM.EXE, proas.exe, WAVCMP.LIB... all I can
say is: "there you go".
I use'm all the time.
My only regret is that I only use them to build them! I wish, instead,
I was in your place (maybe), and had cause to use them! I can imagine
being a recording engineer, or database programmer, and having a real
need for this stuff. Or, as an independent developer writing a game or
other application.
Tell me about some other program that will record at 88,200 Hz, please!
Or will stat all .wav or .voc files, please! Or (un)compress!
Now that I can play the SB and record it and all other inputs on the
PAS, in the background(!), well, my head is five feet wide!
Here's a little joke I played for awhile: I recorded random FM at
88,200, then played it back at 12,000-4,000 (nearly so-to-truly subsonic)
whenever people came into my cube regarding bugs in "-------.exe", in the
background, so no one knew! (Maybe I make people uncomfortable, anyway.)
The following text is merely for informational purposes, and really only
for those that use "tail" on documents to see what is at the end, and I
don't want those of you who read all of the above to be cheated by those
who skip to the last screen!
This software is copyrighted, and unauthorized use or application may or
may not warrant or require remedy or remuneration if unlawful or illegal
copies or replications are made or distributed, subject to civil or
criminal penalties.
If you would like to become a registered user of this and its associated
softwar, please post some mail that includes your first name and your
age to
Media Vision
3185 Laurelview Court
Fremont, CA 94538
Attn: Software Engineering, DOS
or fax the same to
(510) 226-2582
----------------------------------------------------------------------------
Copyright (c) 1992-1993. Media Vision, Inc. All Rights Reserved.
Programmer: Bart Crane