emacspeak-dt-tcl - A tcl language interface between Emacspeak and the
DoubleTalk

T. V. Raman wrote the interface between his Emacspeak and the DECtalk
in TCL.  I have adapted it for the DoubleTalk synthesizer.

T. V. Raman bears no responsibility for this code.  Questions,
problems, or suggestions should be sent to me, not him.

For the most recent version of this code, check the BLinux FTP archives:

	ftp://leb.net/pub/blinux/emacspeak/blinux

You can also look on my web page:

	http://www.mv.com/ipusers/vanzandt/

For general information on Emacspeak, please consult the Emacspeak home page:

	http://www.cs.cornell.edu/Info/People/raman/emacspeak/emacspeak.html

There is also an Emacspeak mailing list.  To subscribe, send a message to:

	"greg e. priest-dorman" <priestdo@cs.vassar.edu>

PREPARATION

Before you can use this driver, you have to install emacspeak.  If you
have a recent Slackware Linux cdrom, you will find an emacspeak
package in the /contrib directory.  You can install and configure it
with commands something like this:

	# installpkg /cdrom/contrib/emacspeak.tgz
	# /var/adm/setup/setup.emacspeak

There are also Red Hat and Debian packages, both at the usual ftp
sites for those distributions, and at leb.net (see above).

This DoubleTalk driver works with either the DoubleTalk LT (connected
to a serial port), or the DoubleTalk PC (internal DoubleTalk).  For
the internal DoubleTalk, you also need the device driver.  Currently,
this is available from ftp://leb.net/blinux in a separate package with
a name like dtlk-1.12.tar.gz.  It must be compiled, the resulting
module must be installed, and a matching device /dev/dtlk must be
created.  There is also a Debian dtlk package.


INSTALLATION

Configure the source code with the command
	./configure

Build with
	make

(Currently this doesn't do anything, since this driver is implemented
in tcl which needs no compilation.)

Install by becoming the superuser and typing
	make install

This installs the driver in /usr/share/emacs/site-lisp/emacspeak/.
TESTING

A man page is included in the driver package.  You can read it with
something like this:

   nroff -man dtk-dt.1|less

You have to set the environment variable DTK_PROGRAM to point to the
driver before you start.  For example,

	export DTK_PROGRAM=dtk-dt

Under Linux, emacspeak uses the first of the following devices:
 the value of the environment variable DTK_PORT if it is set, or
 /dev/dtlk if it exists and can be read from and written to, or
 /dev/ttyS0.  

If you execute this script:

	find-dt

then the DoubleTalk will speak the name of the port.

If you have a DoubleTalk connected to a serial port other than the
first one (/dev/ttyS0 under Linux, or COM1 under DOS), then set
DTK_PORT.  For example, for the second serial port, which is COM2
under DOS, you would use this:

	export DTK_PORT=/dev/ttyS1

You may want to add this line to .profile in your home directory, or
/etc/profile so all users inherit those environment settings.

If the port is set up for the right speed, you can check the
connection and port number with echo:

	echo $'this is a test\r' >/dev/ttyS1

(When text in single quotes is preceded by a dollar sign, bash expands
escape sequences in the text.  Here, I am using this to generate an
explicit carriage return).  You can similarly test the internal
DoubleTalk like this:

	echo $'this is a test\r' >/dev/dtlk

In the above, I have assumed you use bash or another derivative of the
Bourne shell.  For csh and its relatives, you would type this, or put
them in .cshrc in your home directory:

	setenv DTK_PROGRAM dtk-dt
	setenv DTK_PORT /dev/ttyS1

Start Emacspeak with the command 
	emacspeak
which is a shell script installed in /usr/local/bin or /usr/bin.

ADVANCED TESTING

You can test in the build directory by installing the driver (as
above) then typing these commands:

	source setup
	./testing

"testing" is a script which uses strace to log system calls, which
include all the data read or written by the driver.  There is one log
file for each process created.  The first file, for the process
executing the emacspeak script, is named "log".  The other files have
names which include the process number, like log.11180.  To see what
process each comes from, look for the execve system call near the
beginning of the log file.  Here is one for the tcl process that
executes the driver script:

	log.11181:21:08:31 execve("/usr/bin/tcl", ["/usr/bin/tcl", "/usr/share/emacs/site-lisp/emacspeak/dtk-pgm"...], [/* 26 vars */]) = 0

I have had the system lock up while recording system calls in this
way.  This happened when I went into info mode with C-h I and tried to
access one of the info files.  However, the same commands worked fine
when I was not recording system calls.

PROBLEMS

This driver does not yet support interrogation of the speech
synthesizer.  As a result, it will not work with early versions of the
DoubleTalk and LiteTalk which do not support tone commands.

If other things are not working, please review the file
TROUBLESHOOTING first.  If that does not help, please let me know.
When you write, please include as many of these as you can:

	Linux distribution (Red Hat, Slackware, Debian, custom, etc.)
	Linux kernel version
	emacspeak version number
	emacspeak-dt-tcl version number
	DoubleTalk type (PC or LT), serial number, and ROM version number.

                       - Jim Van Zandt <jrv@vanzandt.mv.com>

---------------------------------------------------------------------

 Copyright (C) 1995, 1996, 1997  T. V. Raman  Adobe Systems Incorporated
 All Rights Reserved. 

 This file is not part of GNU Emacs, but the same permissions apply.

 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, or (at your option)
 any later version.

 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
