tomwalters@0: tomwalters@0: tomwalters@0: Appendix C Output File Formats tomwalters@0: tomwalters@0: This Appendix describes the format of output from the ASP modules, for tomwalters@0: users who wish to process this output with another program of their own. tomwalters@0: For example, gensai produces a stabilised auditory image which is suitable tomwalters@0: as input to a speech recognition system. In most cases the output file tomwalters@0: will probably require an additional processing step before it may be used tomwalters@0: by another program. tomwalters@0: tomwalters@0: Each ASP module produces an output file in response to the -output option. tomwalters@0: These output files consist of a header (containing information concerning tomwalters@0: the makeup and history of the file) followed by a series of 16-bit data tomwalters@0: items which represent the actual data contained in the file. tomwalters@0: tomwalters@0: There are two obvious ways in which such a data file may be used as input tomwalters@0: to a user's own program; firstly, the user's program may be adapted to read tomwalters@0: and interpret the header of ASP output files before actually processing the tomwalters@0: data in them, and secondly, the header may be removed and the relevant tomwalters@0: information entered into the user's program manually before it proceeds to tomwalters@0: process the data section of the ASP output file. The former of these tomwalters@0: techniques is preferable in many ways, providing consistency and insulating tomwalters@0: the user from the details of ASP headers, although it may require some tomwalters@0: effort to alter the user's program to correctly process these headers. The tomwalters@0: second method may be preferable if the user is merely interested in testing tomwalters@0: the ASP software's suitability as a preprocessor for their program, or if tomwalters@0: the program in question cannot be altered (either because it was purchased tomwalters@0: from someone else, or because it would be too complicated to change it). tomwalters@0: tomwalters@0: The second method merely requires a reliable way to separate an ASP output tomwalters@0: file into header and data sections, and the user must then 'translate' the tomwalters@0: information in the header into the terms understood by the parameters of tomwalters@0: his/her program. To this end, the ASP package includes two programs called tomwalters@0: head and tail which take an ASP output file as their argument and produce tomwalters@0: another file containing its header and data sections, respectively. The tomwalters@0: header is adapted to resemble very closely an ASP module's options file, tomwalters@0: and ought to be easily understood by anyone familiar with the ASP modules tomwalters@0: and the way in which they are used. As far as translation concepts from tomwalters@0: ASP to another program is concerned, we can only volunteer this tomwalters@0: documentation as a guide to the interpretation of each ASP option. tomwalters@0: tomwalters@0: The former of the two methods requires rather more detailed understanding tomwalters@0: of the output file structure, and this discussion will be divided into two tomwalters@0: parts, one on the header and the other on the data itself. tomwalters@0: tomwalters@0: Head and Tail tomwalters@0: tomwalters@0: For users who wish to remove the header part of an ASP output file, the tomwalters@0: software includes two programs called head and tail which take an ASP tomwalters@0: output file as their argument and produce another file containing its tomwalters@0: header and data sections, respectively. The header is adapted to resemble tomwalters@0: very closely an ASP module's options file, and ought to be easily tomwalters@0: understood by anyone familiar with the ASP modules and the way in which tomwalters@0: they are used. As far as translation of concepts from ASP to another tomwalters@0: program is concerned we can only volunteer this documentation as a guide to tomwalters@0: the interpretation of each ASP option. tomwalters@0: tomwalters@0: Whichever method the user chooses in combining ASP output files with their tomwalters@0: own programs, some information regarding the types and format of tomwalters@0: information in ASP output modules will be needed. Discussion of the tomwalters@0: structure of the output files will be divided into two sections, one on the tomwalters@0: header and the other on the data itself. tomwalters@0: tomwalters@0: The header tomwalters@0: tomwalters@0: Each ASP module's output file contains a header which provides information tomwalters@0: about the origin and history of the data in the file. This information is tomwalters@0: used by subsequent modules in the ASP hierarchy, as described in Appendix tomwalters@0: B. The header is a sequence of ASCII characters (and is thus readable, so tomwalters@0: even using more on the output file would produce sensible text for the tomwalters@0: duration of the header). This sequence is divided into three parts. tomwalters@0: tomwalters@0: 1 An identifying line. tomwalters@0: tomwalters@0: 2 A series of option setting lines. tomwalters@0: tomwalters@0: 3 NULL (ASCII 0) character. tomwalters@0: tomwalters@0: The identifying line is a means of determining, from the first few tomwalters@0: characters in a file, whether that file is in fact an ASP output file. It tomwalters@0: also is used for determining the length of the header as a whole; thus, tomwalters@0: each output file begins with a string such as: tomwalters@0: tomwalters@0: header_bytes=0000709 tomwalters@0: tomwalters@0: where header_bytes is the identifying string (which actually descended from tomwalters@0: the 'pipes' signal processing language) and the header is 709 bytes long. tomwalters@0: The length of the header includes the identifying line and the final NULL tomwalters@0: character. tomwalters@0: tomwalters@0: Each option setting line is of the form: tomwalters@0: tomwalters@0: