Waveform and Segment Name Specification

When using ASEL programs that read or write waveform files, there are some special features to keep in mind. Because waveform files may contain named regions or segments and because they may have more than one channel of data, the normal Unix or DOS filename convention has been extended to allow particular regions and/or channels to be indicated as part of the file name. This allows programs to address individual regions and/or channels of data within a waveform file rather than always addressing its full contents.

A fully qualified waveform file name has the syntax:

where only the basename of the file is required, but the name can optionally contain an extension (.wav by default), a segment name up to 6 characters in length indicating a waveform region that is defined within the file (see edw (1) on how segments are defined), and a channel number ranging from 0 to N-1 where N is the number of channels of data represented in each record of the waveform file.

This syntax applies to all of the programs which have been written at ASEL to read or write either ASEL or RIFF format files. In the following examples, the play program is used for illustration. The play program is a simple application program which accepts a waveform filename on the command line and sends the waveform data to whatever hardware audio device is present. So the command

play sentence
would play the entire contents of a file called sentence.wav. However, if the play program was invoked with the command
play sentence$word1
only the region of sentence.wav labeled word1 would be played. Similarly, if sentence.wav happened to contain stereo data, the play program (which only plays mono signals) would still work, but would play only the first (left by convention) channel. This could be indicated explicitly by the command
play sentence#0
which causes only channel 0 to be read. Alternatively, the right channel could be played with the command
play sentence#1
Channel and segment information can be specified at the same time as in
play sentence$word1#1
which would play only channel 1 of word1 in sentence.

One important note of caution. On some systems, notably Unix systems, the characters $ and or # may have special meaning to the command line interpreter or shell program. On such systems it is necessary to 'escape' the $ and # characters so that they are not interpreted by the system. For instance, on Unix systems, the $ character must always be escaped to allow it to pass through to the play program itself. Thus, on Unix one must enter the commands above as, for example,

play sentence\$word1#1
where the '\' character indicates that the $ is not to be interpreted as a special character by the shell.

Special escape characters are not necessary for MS-DOS and Windows versions of this software.

Finally, it bears repeating that the segment and channel specification works with RIFF files like the standard .wav files in Windows, but uses some extensions to the RIFF standard that were developed at ASEL. These extensions comply with the RIFF standard so that segment information added to a RIFF file should not 'spoil' the file for any other software, but only software developed at ASEL is able to take advantage of the extensions to RIFF. A library of I/O and utility functions which supports ASEL and this extended RIFF format is available. The library supports C and Fortran compilers on several Unix platforms and on MS-DOS platforms (using Microsoft C and Fortran 77). See the Waveform I/O Library description for more details.