Netaudio - Townshend Computer Tools DAT-Link User Manual

Table of Contents

Advertisement

186
NAME
mendparams, adparams, frmavg, mendpoint – library routines for DAT-Link recording with speech seg-
mentation
D
ESCRIPTION
These routines allow C or Fortran programs to access a NetAudio server on the local machine or other
machines connected via a network to record speech segments with automatic segmentation of words
T
hese routines use underlying netaudio(3) calls to insulate the user from the normal NetAudio interface
providing a easy-to-use replacement for existing software.
ROUTINE
S
void adparams(ifreq, iwind, ishift, alpha)
int ifreq, iwind, ishift;
d
ouble alpha;
Setup an speech acquisition connection via the NetAudio server specified by the Open a con-
nection to the NetAudio server specified by the
will be recorded from the left channel of the DAT-Link's digital audio input at a sampling rat
s
pecified by irate. For segmentation purpose, data is blocked into frames of iwind samples and
average energy over the frame is computed by the DAT-Link. Each frame begins ishift sam
p
les after the previous frame. Note that iwind must be an integer multiple of ishift less than
20. Typical values are irate = 8000, iwind = 120, and ishift = 30.
P
re-emphasis is used on the incoming data using a first order filter with feedback coefficient
given by alpha. A value of alpha of 0.95 typically provides good results.
v
oid mendparams(k1,k2,l1,l2,npre,npost,nevent,iending,frmav)
int k1,k2,l1,l2,npre,npost,nevent,iending;
d
ouble frmav;
Sets up the parameters for speech segmentation used by subsequent calls to mendpoint(). The
parameters, k1andk2 set the thresholds for beginning a segment and for positive recogition of
w
ord respectively. Both of these should be given as a factor of frmav, the expected back-
ground noise level. Typical values are k1 = 2 and k2 = 10.
l
1 is the maximum number of frames above the k1 threshold that will be accepted before the
k2 threshold is exceeded. The l2 duration is the minimum number of frames needed to form
v
alid segment. Typical values are l1 = 7 and l2 = 15.
npreandnpost set the number of frames that each segment will be extended at either end t
g
uarantee that the lead-in and trailing edge are not truncated. A value of 10 is suitable for
both of these.
R
ecording will continue until nevent segments are recorded or iending frames of silence are
encountered after at least one segment has been acquired.
v
oid frmavg(frmav, numsecs)
float ∗frmav;
d
ouble numsecs
This routines measures the background noise level by recording for numsecs seconds and cal-
culating the average energy. The resulting value is stored at the address pointed to by frmav
N
ote that it is up to the user to remain silent while frmavg() is executing or the estimate will
be wrong.
v
oid mendpoint(buffer, nsamps)
short ∗buffer;
nt ∗nsamps;
i
Begin recording data into buffer until nsamps are acquired or the number of segments specified
by a prior call to mendparams() are obtained. The actual number of samples recorded ar
s
tored at nsamps before returning.

NETAUDIO(3)

environment variable. Data
AUDIO_DEVICE
.
e
-
a
a
o
.
e

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?

Table of Contents