The simplicity of the speech server abstraction described above meant that version 0 of the speech server was running within an hour after I started implementing the system. This meant that I could then move on to the more interesting part of the project: producing good quality spoken output. Version 0 of the speech server was by no means perfect; it was improved as I built the Emacspeak speech client.
A friend of mine had pointed me at the marvels of Emacs Lisp advice a few weeks earlier. Som when I sat down to speech-enable Emacs, advice was the natural choice. The first task was to have Emacs automatically speak the line under the cursor whenever the user pressed the up/down arrow keys.
In Emacs, all user actions invoke appropriate Emacs Lisp
functions. In standard editing modes, pressing the down arrow invokes
next-line, while pressing
the up arrow invokes
To speech-enable these commands, version 0 of Emacspeak implemented
the following rather simple advice fragment:
(defadvice next-line (after emacspeak) "Speak line after moving." (when (interactive-p) (emacspeak-speak-line)))
function implemented the necessary logic to grab the text of the line
under the cursor and send it to the speech server. With the previous
definition in place, Emacspeak 0.0 was up and running; it provided the
scaffolding for building the actual system.
The next ...