1
1
/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
2
/* ====================================================================
3
- * Copyright (c) 1996-2004 Carnegie Mellon University. All rights
3
+ * Copyright (c) 1996-2004 Carnegie Mellon University. All rights
4
4
* reserved.
5
5
*
6
6
* Redistribution and use in source and binary forms, with or without
7
7
* modification, are permitted provided that the following conditions
8
8
* are met:
9
9
*
10
10
* 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.
12
12
*
13
13
* 2. Redistributions in binary form must reproduce the above copyright
14
14
* notice, this list of conditions and the following disclaimer in
15
15
* the documentation and/or other materials provided with the
16
16
* distribution.
17
17
*
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
20
20
* United States of America, and the CMU Sphinx Speech Consortium.
21
21
*
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,
24
24
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25
25
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
26
26
* 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
32
32
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
33
*
34
34
* ====================================================================
@@ -313,7 +313,7 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wtf)
313
313
(0 == strcmp ("big" , cmd_ln_str_r (wtf -> config , "-mach_endian" ))
314
314
? "little" : "big" ));
315
315
}
316
-
316
+
317
317
fseek (fh , 4 , SEEK_SET );
318
318
wtf -> infh = fh ;
319
319
if (cmd_ln_boolean_r (wtf -> config , "-spec2cep" )) {
@@ -328,7 +328,7 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wtf)
328
328
E_ERROR ("Sphinx MFCC file reading requested but -spec2cep/-cep2spec not given\n" );
329
329
assert (FALSE);
330
330
}
331
-
331
+
332
332
return TRUE;
333
333
}
334
334
@@ -448,7 +448,7 @@ decode_pcm(sphinx_wave2feat_t *wtf)
448
448
whichchan = cmd_ln_int32_r (wtf -> config , "-whichchan" );
449
449
fe_start_utt (wtf -> fe );
450
450
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 ) {
452
452
size_t nvec ;
453
453
int16 const * inspeech ;
454
454
@@ -461,7 +461,7 @@ decode_pcm(sphinx_wave2feat_t *wtf)
461
461
/* Mix or pick channels. */
462
462
if (nchans > 1 )
463
463
nsamp = mixnpick_channels (wtf -> audio , nsamp , nchans , whichchan );
464
-
464
+
465
465
inspeech = wtf -> audio ;
466
466
nvec = wtf -> featsize ;
467
467
/* Consume all samples. */
@@ -899,7 +899,7 @@ sphinx_wave2feat_convert_file(sphinx_wave2feat_t *wtf,
899
899
/* Use the maximum of the input and output frame sizes to allocate this. */
900
900
veclen = wtf -> veclen ;
901
901
if (wtf -> in_veclen > veclen ) veclen = wtf -> in_veclen ;
902
-
902
+
903
903
wtf -> feat = (mfcc_t * * )ckd_calloc_2d (wtf -> featsize , veclen , sizeof (* * wtf -> feat ));
904
904
905
905
/* Let's go! */
@@ -930,7 +930,7 @@ sphinx_wave2feat_convert_file(sphinx_wave2feat_t *wtf,
930
930
goto error_out ;
931
931
}
932
932
}
933
-
933
+
934
934
935
935
if (wtf -> audio )
936
936
ckd_free (wtf -> audio );
0 commit comments