Townshend Computer Tools DAT-Link User Manual page 191

Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DAT-Link and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents