Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Commit 961e928

Browse files
committed
Replace magic constant with a calculated value.
git-svn-id: svn+ssh://svn.code.sf.net/p/cmusphinx/code/trunk/sphinxbase@12607 94700074-3cef-4d97-a70e-9c8c206c02f5
1 parent 3478c97 commit 961e928

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/sphinx_fe/sphinx_fe.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
22
/* ====================================================================
3-
* Copyright (c) 1996-2004 Carnegie Mellon University. All rights
3+
* Copyright (c) 1996-2004 Carnegie Mellon University. All rights
44
* reserved.
55
*
66
* Redistribution and use in source and binary forms, with or without
77
* modification, are permitted provided that the following conditions
88
* are met:
99
*
1010
* 1. Redistributions of source code must retain the above copyright
11-
* notice, this list of conditions and the following disclaimer.
11+
* notice, this list of conditions and the following disclaimer.
1212
*
1313
* 2. Redistributions in binary form must reproduce the above copyright
1414
* notice, this list of conditions and the following disclaimer in
1515
* the documentation and/or other materials provided with the
1616
* distribution.
1717
*
18-
* This work was supported in part by funding from the Defense Advanced
19-
* Research Projects Agency and the National Science Foundation of the
18+
* This work was supported in part by funding from the Defense Advanced
19+
* Research Projects Agency and the National Science Foundation of the
2020
* United States of America, and the CMU Sphinx Speech Consortium.
2121
*
22-
* THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
23-
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22+
* THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
23+
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
2424
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2525
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
2626
* NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3232
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
*
3434
* ====================================================================
@@ -313,7 +313,7 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wtf)
313313
(0 == strcmp("big", cmd_ln_str_r(wtf->config, "-mach_endian"))
314314
? "little" : "big"));
315315
}
316-
316+
317317
fseek(fh, 4, SEEK_SET);
318318
wtf->infh = fh;
319319
if (cmd_ln_boolean_r(wtf->config, "-spec2cep")) {
@@ -328,7 +328,7 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wtf)
328328
E_ERROR("Sphinx MFCC file reading requested but -spec2cep/-cep2spec not given\n");
329329
assert(FALSE);
330330
}
331-
331+
332332
return TRUE;
333333
}
334334

@@ -448,7 +448,7 @@ decode_pcm(sphinx_wave2feat_t *wtf)
448448
whichchan = cmd_ln_int32_r(wtf->config, "-whichchan");
449449
fe_start_utt(wtf->fe);
450450
nfloat = 0;
451-
while ((nsamp = fread(wtf->audio, 2, wtf->blocksize, wtf->infh)) != 0) {
451+
while ((nsamp = fread(wtf->audio, sizeof(int16), wtf->blocksize, wtf->infh)) != 0) {
452452
size_t nvec;
453453
int16 const *inspeech;
454454

@@ -461,7 +461,7 @@ decode_pcm(sphinx_wave2feat_t *wtf)
461461
/* Mix or pick channels. */
462462
if (nchans > 1)
463463
nsamp = mixnpick_channels(wtf->audio, nsamp, nchans, whichchan);
464-
464+
465465
inspeech = wtf->audio;
466466
nvec = wtf->featsize;
467467
/* Consume all samples. */
@@ -899,7 +899,7 @@ sphinx_wave2feat_convert_file(sphinx_wave2feat_t *wtf,
899899
/* Use the maximum of the input and output frame sizes to allocate this. */
900900
veclen = wtf->veclen;
901901
if (wtf->in_veclen > veclen) veclen = wtf->in_veclen;
902-
902+
903903
wtf->feat = (mfcc_t**)ckd_calloc_2d(wtf->featsize, veclen, sizeof(**wtf->feat));
904904

905905
/* Let's go! */
@@ -930,7 +930,7 @@ sphinx_wave2feat_convert_file(sphinx_wave2feat_t *wtf,
930930
goto error_out;
931931
}
932932
}
933-
933+
934934

935935
if (wtf->audio)
936936
ckd_free(wtf->audio);

0 commit comments

Comments
 (0)