EasyManua.ls Logo

Radio Shack TRS-80 Voxbox - Page 25

Radio Shack TRS-80 Voxbox
36 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
How
To Write
Your
Own
Application
Programs
Frequently
a
small subroutine
is helpful
to
organize
the
flow
of
your
program.
For example, the following program
lines let
you
"train"
the
VOXBOX on the
words "ZERO"
and
"ONE."
(This
assumes
ADR
contains
the proper address for
your
system from
the
Initialization
routine, lines
10-100
above.) See Appendix
B for
DISK
BASIC
equivalents.
110
'
200 REM
TRAIN
ON
DIGITS
&
1
210 REM
TR-
INDEX
220 REM
TRAIN
DIGIT
ZERO
230
TR=0
240 PRINT
"SAY.
.
.
..
»
JTR
250
GOSUB
1000
260
TR=1
270
PRINT
"SAY..
. .
.
»?TR
260
GOSUB
1000
290
'
1000 REM
CALL
TRAINING
1010 TA
=AD
-s-1.018
1020 IF
TR
>
32767 THEN
TA
=TA
--65536
1030 POKE
16526?
1040
POKE
16527? AD
1050
POKE
TA?
TR
1060
X=USR(0)
1070 IF
PEEKn'A)
<>
THEN
GOTO
1090
1080
RETURN
1090
PRINT
"ERROR
-
PLEASE
REPEAT"
1100
GOTO
1030
After executing X=USR(0) (line
#1060)
the
VOXBOX
will be
listening. Parameters from that
word will
be stored
away,
associated
with the training index, TR. The
word
or phrase
spoken
may
be up
to 1
.5
seconds long with one or
more embedded
silences
not
exceeding
0.
1
seconds. A silence of 0.
1
second
or longer
signals
the
end
of the
word.
After each training word is spoken,
an error
code
is returned
at
the
same location (TRA) where the training
index,
TR,
was
POKE'd.
If the speech
presented to VOXBOX
was
longer
than
1.5
seconds
the contents of the location will
be non-zero.
If no
error
occurred,
the
contents
of the location
will be zero. This
can
be checked
as in
line #1070 above.
23

Related product manuals