How
To Write Your
Own
Application Programs
Initialization
(Entry at Relocation
+6)
Note:
The term
"Relocation" refers to the
actual first
address
of the
driver program in
your system. If
you
loaded
driver
program
SP16,
then
Relocation=28672; if SP32, then Relocation=45056;
if
SP48,
Relocation=61440.
The
Initialization routine clears all tables before
use. Previously
stored
speech samples
will
be
lost. Initialization is
usually run
once
just
before
VOXBOX is trained. First set up the
USRfunction
by
POKEing (Level II) or
DEFUSR (DISK
BASIC).
The entry
address
equals Relocation
+6.
Then execute the statement,
X=USR(0);
the
computer will branch to
"Initialization,"
using (in
Level
II) the
data in
memory
locations 16526 and 16527.
For
example (See Appendix B) for DISK
BASIC
equivalents):
10 REM SE1
r
UP CALL.ING
PA RAMETIERS
20
REM MS==MEMO RY SIZE IN
K-BYTES
30 PRINT
"
I
S
THIS A 1
6K
?
32K
OR
48K
35 INPUT
"
(
1
lYPE
16? 32 C)R 48 )
"
5
MS
40 IF MS
=
16 THEN AD
=
1
1
i
GOTO
80
50 IF
MS
=32
THEN AD
=
176*
GOTO 80
60 IF MS
=48
THEN AD
=240
s
GOTO 80
70
80
GOTO
POKE
35
1652::6*6
90 POKE 165^11 1 AD
100 X=USR(0)
i
SYSTEM
Training
(Entry at
Relocation
+0)
Before you can
recognize words you
must
train the
unit on
your (or the
intended
user's) speech
patterns. The training
subroutines
do
this The
training subroutine must
be called
once for each
word,
or
sample of a word, to be
later recognized.
Usually,
you
will want to tell
the speaker which
word he's
to
say
through the
video display by, for
example,
printing
out a
statement
that says
"SAY
. . .
START"
when "start" is
the intended
word,
and
then immediately
calling the training routine
for
that word.
There are
32 slots in the VOXBOX
table for
samples
of
words to be
recognized. They are numbered
to
31.
The
number
(index) of
the
"slot" which is to
receive the
training
parameters
is
passed using
a
POKE
command,
as
are the
addresses of
the subroutine.
First set up a
USR routine with
entry at the
Relocation
Address.
Then
call the routine each
time
you
want the user
to
input
a
word or phrase
for
training.
22