Chapter 12
Subroutine Library
In addition to to the programs described in the previous chapters,
DAT-Link
also
comes with an extensive programmer's library that can be used to write your own
programs. To use the library functions from a C program, you need to include
the NetAudio header le,
netaudio.h
at the beginning of your program. This le
can b e found in the
include
subdirectory of the directory in which the
DAT-Link
software was installed. Also, you will need to add
libnetaudio.a
and
libsupp ort.a
to the list of libraries used for linking. These library le can be found in the
lib
subdirectory. For example, if the
DAT-Link
programs were installed in
/usr/lo cal
,
the following commands can b e used to compile and link the program,
test.c
, that
uses the NetAudio library:
cc -c -I/usr/local/include test.c
cc -o test test.o /usr/local/lib/libnetaudio.a \
/usr/local/lib/libsupport.a -lm
The NetAudio library function are described in detail in the manual pages included
in Appendix G. Although there are many routines, p erforming most functions
requires only a few of them. For example, to playbacka buer of stereo data at
8000 samples/second with a gain of 2.0, the following co de segmentwould suce: