Extending AsTeR

[Next] [Up] [Previous]
Next: Producing different audio Up: Audio system for Previous: Examples of use

Extending AsTeR

  The quality of audio renderings produced by AsTeR depends on how much of the document logical structure is recognized. Authors of La)TeX documents often use their own macros[+] to encapsulate specific logical structures. Of course, AsTeR does not initially know of these extensions. User-defined La)TeX macros are initially rendered in a canonical way; typically, they are spoken as they appear in the running text. Thus, given a document containing


AsTeR would say

cap a kronecker cap b
In this case, this canonical rendering is quite acceptable.

In general, how AsTeR renders such user-defined structures is fully customizable. The first step is to extend the recognizer to handle the new construct, in this case, \kronecker. s:macro-objects explains the principles on which such extensions are based. Here, we give the reader a brief example of how this mechanism is used in practice.

The recognizer is extended by calling Lisp macro define-text-object as follows:


This extends the recognizer; instances of macro \kronecker are represented by object kronecker. The user can now define any number of renderings for instances of object kronecker.

AFL (see c:afl), our language for audio formatting, is used to define rendering rules (see c:rules_and_styles). Here is one such rendering rule for object kronecker:


AsTeR would now speak $A \kronecker B$ as

kronecker product of cap a and cab b.
Notice that the order in which the elements of [tex2html_wrap5250] are spoken is independent of the order in which they appear on paper. AsTeR derives its power from representing document content as objects and by allowing multiple user-defined rendering rules for individual object types. These rules can cause any number of audio events (ranging from speaking a simple phrase, to playing a digitized sound). Once the recognizer has been extended by an appropriate call to define-text-object, user-defined macros in La)TeX can be handled just as well as any standard La)TeX construct.

To give an example of this, the logo that appears on the first page of this chapter is produced by La)TeX macro \asterlogo. After extending the recognizer with an appropriate call to define-text-object, we can define an audio rendering rule that produces a bark when rendering instances of this macro.

[Next] [Up] [Previous]
Next: Producing different audio Up: Audio system for Previous: Examples of use

TV Raman
Thu Mar 9 20:10:41 EST 1995