[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting close (Re: Accent SA in Emacspeak-22)

Here's my first try for Accent SA support in Emacspeak-22; I have
created the needed accent-voices.el based on the functions defined in
dectalk-voices and outloud-voices (primarily assigning freq and
headsize qualities) and I've edited the accent tcl to remove emulating
the dectalk codes (among other things).  

My apologies to the original authors ;)

The good news is it works pretty well on preliminary testing.

Some additional changes to get it working: 

1) I had to make one change to tts-lib.tcl to expose the port number
so that the port can be configured to device-specific requirements.

     set port [which_port $machine]
+    set tts(port)  $port
     set tts(read)  [open $port  r]

2) I then registered the new DTK_PROGRAM string

--- dtk-speak.el.orig   2005-04-30 12:44:31.000000000 -0400
+++ dtk-speak.el        2005-05-28 12:07:38.000000000 -0400
@@ -58,6 +58,8 @@
 (require 'dtk-interp)
 (require 'dectalk-voices)
 (require 'outloud-voices)
+(require 'accent-voices)

 ;;{{{  user customizations:
@@ -1386,6 +1388,10 @@
    ((string-match "dtk-" tts-name) ;all dectalks
+   ((string-match "accent" tts-name) ;AccentSA external synth
+    (accent-configure-tts))

accent-voices.el is based on outlook-voices and the dectalk-voices,
implementing the voice-selection functions in native Accent control
codes instead of attempting to emulate the Dectalk codes in the TCL.

Now the problems:

1) Most Accent codes are all of the form Escape Capital-Letter Number,
   and these run into problems during the 'clean' function where the
   server is expected to re-write all-caps and mixed-caps words.  my
   debug code still showed Accent control codes being downcased, and
   when I tried preventing the processing on elements beginning with
   \e, legitimate allcaps strings would throw it into an unterminating

for the time being, I have commented out the allcaps loop.  Advice on
how to fix it is most welcome.  

2) on typing any keystroke such as 'a', the accent read back

       zero e a

These "zero e" lines were traced to another needed change in
tts-lib.tcl, and artifact of my enabling debug mode: I had to remove
some debug code in queue_clear

    proc queue_clear {} {
        global tts queue
    -   if {$tts(debug)} {
    -   puts -nonewline  $tts(write) "$tts(q_head) e\013"
    -   }

3) I traced the skipped voice-feedback problem to the use of CTRLX
   flush. This feature was not being enabled by the initstring because
   the initial CTRL-R command requires several seconds for
   diagnostics; most of the subsequent initialization codes were being

I switched to the soft-restart code and inserted a 100ms wait, and
things suddenly went a lot better :)

4) I can't trace this one, it's minor but annoying:  In my init
   file I have a message at the end to say "all set ... lets go emacs"
   but this appears in the debug trace as

   q: \eOp\eP6\eV6\eM2all set  aw 3 . lets go emacs!  \eP5 \eV5

this is input to the 'q' function, and /prior/ to the 'clean'
function. "..." has become "aw 3" -- that "aw 3" appears periodically,
and I haven't yet found any code that would explain it.

Despite this little problems, I can now find a file, enter text, I can
even use the VM email software and w3-mode -- I still have to fine
tune the voice modulation settings and work on the tone stuff, but so
far so good.

Just in case it's useful, I've attached a tarball of the two Accent
files and a patch file suitable for Emacspeak-22 -- if you enable
the debug mode, it will also print full trace information to an
"accent.log" file in the current directory.

Emacspeak-22 support for the AccentSA

Gary Lawrence Murphy <garym@linux.ca>: office voice/fax: 01 519 4222723
  Business Advantage through Community Software - http://teledyn.com
"what I need is a job that doesn't interfere with my work" -gary murphy