NETAUDIO(3) 187
NOTES
The above routines must be called in the sequence: adparams, frmavg, mendparams, mendpoint.
N
Once mendpoint completes, adparams must be again called before mendpoint can be called again.
ote that although speech segmentation is performed by mendpoint, the resulting information is dis-
D
carded. The sole use of the segmentation is as a criteria of when to stop recording.
uring the execution of these routines, the DAT-Link will be loaded with a special DSP program to do
l
r
the energy computations. If a program is interrupted before mendpoint() completes, this program wil
emain loaded. The NetAudio program, naloaddsp(1) must then be used with no arguments to unload
T
the program.
he subroutine interface lacks certain features such as setting the input source, channels, etc. It was so
d
s
designed such that it matches certain customers existing interface. Also, call by address is always use
o that Fortran programs can directly call these routines.
:
#
The following code example shows a typical use of these routines to record 4 segments of speech
include <fcntl.h>
"
#
#include "libsegment.h
include "defaults.h"
v
#include "debug.h"
oid main(argc,argv)
c
int argc;
har ∗argv[];
{
int ifreq = 8000;
;
fl
float wind = 0.015
oat shift = wind/4;
i
float alpha = 0.95;
nt iwind = wind∗ifreq;
fl
int ishift = shift∗ifreq;
oat frmav, frmtime=2.0;
i
int k1 = 2;
nt k2 = 10;
i
int l1 = 7;
nt l2 = 15;
;
i
int npre = 10
nt npost = 10;
;
i
int nevent = 4
nt iending = 67;
;
s
int nsamps = 1000000
hort buffer[1000000];
I
int fd;
nitDefaults(argv[0]);
adparams(&ifreq,&iwind,&ishift,&alpha);
m
frmavg(&frmav,&frmtime);
endparams(&k1,&k2,&l1,&l2,&npre,&npost,&nevent,&iending,&frmav);
f
mendpoint(buffer,&nsamps);
d = open("speech.out",O_WRONLY|O_CREAT|O_TRUNC,0644);
N
}
write(fd,buffer,nsamps∗sizeof(buffer[0]));
etAudio Reference Last change: 1993/04/16 2