home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio 4.94 - Over 11,000 Files
/
audio-11000.iso
/
msdos
/
sndbords
/
proaudio
/
tpcm35
/
tpcm.doc
< prev
next >
Wrap
Text File
|
1993-03-26
|
21KB
|
666 lines
TPCM - Test PCM
Syntax
tpcm [-T] [-dqmL] [-v#p#c#] [-B#D#] sound.wav ...
playback mode on PAS/SB using .wav files
tpcm [-T] [-dqmL] [-v#p#c#] [-B#D#] [-r#l#s] [-iname]
playback mode on PAS/SB using raw sound data
tpcm -R[X][V#] [-dqmL] [-v#p#c#] [-B#D#] [-r#l#s] sound.wav
record mode into .wav file (optionally voice-activated)
Options
-T playback on Thunderboard
requires "set BLASTER=..." in environment, or
previously loaded "pcm.com" using "-tPPP,D,I" option
-R[X] record mode, X= compression method; default: none
The program will record into a compressed format in
real-time, using (I)ma, (A)law, (M)ulaw.
-V# voice activated threshold value
-d debug mode, output status
during voice-activated record mode, displays the
time at which recording was activated, and the
current buffer offset.
-q quiet mode (no sound or DMA transfers)
-m toggle use Monochrome Screen Buffer for DMA
-L Loop sound continuously until ESCAPE
-v[#] #= video display image # (1-3, see ref) default: 1
-p# #= palette # (1-8) (default: 2 (6 if -v2 specified))
-c# #= cycle palette with delay (default delay: 1)
sound.wav ... = name(s) of sound files to playback
If the file specified is not recognized, then
the default samplerate, datasize and channels
are used, unless new values are specified using
the options below (-r, -l, -s).
-r# #= default samplerate (decimal) default: 11025
-l# #= size of sample in bits (decimal) default: 8
-s treat as stereo (default: mono)
If the file specified is of a recognized format,
then these values are ignored.
-iname name= name of raw PCM file (no or unknown header)
Use the -r, -l and -s options to specify the
samplerate, datasize and mono/stereo parameters.
Note: -iname and "sound.wav ..." are mutually exclusive
-w# #= delay in clock ticks before timing-out; default: 4
This option prevents "looping" for IRQ conflicts.
-t# #= number of seconds to record
-B# #= DMA Buffer size (KB if <= 64, else Bytes)
default: 32K, 16K if using monochrome (-m)
To specify a 64K buffer, use -B64
To specify a 64000 buffer, use -B64000
-D# #= number of DMA Divisions
default: 16 if video, else 8
-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 -RI -r44100sl16 cdqualty.cmp
This records into the file "cdqualty.cmp" at 44100Hz,
16-bit stereo, and compresses using the IMA 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 using "factors" (large jumps)
, . slow/speed playback rate
Use these keys to slowdown/speedup the playback/record
rate in increments of 100Hz.
R Enter new Samplerate
If "debug" mode is on, then a prompt is displayed,
and the program accepts a new samplerate.
m display "mark", ticks/bytes/samples
Use this key to display the current offset into the
playback/record buffer.
l toggle "looping"
Use this key to activate/deactivate looping back to
start after end of sound file.
x toggle "debug"
p Pause Playback/Record
Press another key to resume playback/record.
i Display current samplerate, channels, datasize
! Get command shell
ESC exit current sound 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
v Cycle Video Backgrounds
Operation
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.
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").
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.
Use this option when attempting to locate valid DMA/IRQ combinations,
or otherwise attempt to debug your sound card's operation.
When using the voice-activated record mode, the output will be merely
the current time and buffer offset when recording begins. Redirect
this output to a file for later reference to sound clips of interest.
-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.
Use these options to process "raw" data.
This option will also process "raw compressed" formats, using the
following syntax:
-ifile.ext,F,OFFSET,LENGTH
F= format p= PCM (8), i= IMA (4), a= ALAW (8), m= MULAW (8)
OFFSET= point within file to begin decompression
LENGTH= amount of data to process
The (#) indicates the default "datasize" used for the format,
although it can be overridden using the "-l#" option.
For instance, suppose you get some "sound file" of an unknown type.
You could use this program to attempt to listen to the file:
C:> tpcm -isound.dmp -l8
... try 8-bit PCM ...
C:> tpcm -isound.dmp -l16
... try 16-bit PCM ...
C:> tpcm -isound.dmp,i
... try 4-bit IMA ...
C:> tpcm -isound.dmp,a
... try 8-bit ALAW ...
C:> tpcm -isound.dmp,m
... try 8-bit MULAW ...
Additionally, using a "dump" program, you might see 38hex bytes of
"header" information. You could skip over this data and decompress
the remaining using IMA like so:
C:> tpcm -isound.dmp,i,38h
Similarly, if, while playing some "unknown" file type, you hear sound,
you can "mark" the beginning and end of the cut (using the 'm' key
during playback), then use the -i option to specify what format, how
far in and for how long to play:
C:> tpcm -isomefile.dat,p,14469,44100 -r11025 -l16 -s
Admittedly, only very few persons will ever use this option to its
fullest extent, but, here you go.
-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.
-B
Use the -B option to specify the size of the DMA buffer. If this number
is <= 64, then the value is inferred as KB. Otherwise, it is assumed to
be the size of the DMA buffer in Bytes.
"-B64" specifies a 64x1024, or 64KB size buffer
"-B64000" indicates 64000Byte size buffer
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.
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, otherwise the DMA controller
will transfer the remaining data (which will be, presumably,
uninitialized and so noisy).
-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.
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
-R will 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.
-Vx will set Voice-Activated Mode.
The "x" indicates a "threshold" value. DMA buffer divisions not above
the threshold will not be stored on disk.
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).
"pcm.com" (or "pcmfun.com").
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.
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
software, 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