1 /* ====================================================================
2 * Copyright (c) 1998-2000 Carnegie Mellon University. All rights
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
17 * This work was supported in part by funding from the Defense Advanced
18 * Research Projects Agency and the National Science Foundation of the
19 * United States of America, and the CMU Sphinx Speech Consortium.
21 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
22 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
25 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * ====================================================================
36 /*********************************************************************
41 * Command line argument definition
45 *********************************************************************/
50 #include <sphinxbase/cmd_ln.h>
51 #include <sphinxbase/fe.h>
53 const char helpstr[] =
55 Extract acoustic features form from audio file.\n\
57 The main parameters that affect the final output, with typical values, are:\n\
59 samprate, typically 8000, 11025, or 16000\n\
60 lowerf, 130, 200, 130, for the respective sampling rates above\n\
61 upperf, 3700, 5200, 6800, for the respective sampling rates above\n\
62 nfilt, 31, 37, 40, for the respective sampling rates above\n\
64 format, raw or nist or mswav\n\
67 const char examplestr[] =
69 This example creates a cepstral file named \"output.mfc\" from an input audio file named \"input.raw\", which is a raw audio file (no header information), which was originally sampled at 16kHz. \n\
71 sphinx_fe -i input.raw \n\
73 -input_endian little \n\
80 static arg_t defn[] = {
84 "Shows the usage of the tool"},
89 "Shows example of how to use the tool"},
91 waveform_to_cepstral_command_line_macro(),
96 "Argument file (e.g. feat.params from an acoustic model) to read parameters from. This will override anything set in other command line arguments." },
101 "Single audio input file" },
106 "Single cepstral output file" },
111 "Control file for batch processing" },
116 "If a control file was specified, the number of utterances to skip at the head of the file" },
121 "If a control file was specified, the number of utterances to process, or -1 for all" },
126 "Index of the part to run (supersedes -nskip and -runlen if non-zero)" },
131 "Number of parts to run in (supersedes -nskip and -runlen if non-zero)" },
136 "Input directory, input file names are relative to this, if defined" },
141 "Input extension to be applied to all input files" },
146 "Output directory, output files are relative to this" },
151 "Output extension to be applied to all output files" },
156 "Create missing subdirectories in output directory" },
161 "Input is NIST sphere (possibly with Shorten), use sph2pipe to convert" },
166 "Defines input format as NIST sphere" },
171 "Defines input format as raw binary data" },
176 "Defines input format as Microsoft Wav (RIFF)" },
178 #ifdef HAVE_SNDFILE_H
182 "Use libsndfile to read input data" },
188 "Number of channels of data (interlaced samples assumed)" },
193 "Channel to process (numbered from 1), or 0 to mix all channels" },
198 "Format of output files - one of sphinx, htk, text." },
202 #ifdef WORDS_BIGENDIAN
207 "Endianness of machine, big or little" },
212 "Number of samples to read at a time." },
217 "Input is log spectral files, output is cepstral files" },
222 "Input is cepstral files, output is log spectral files" },
224 { NULL, 0, NULL, NULL }
228 #define CMD_LN_DEFN_H
230 #endif /* CMD_LN_DEFN_H */
233 * Log record. Maintained by RCS.
235 * $Log: cmd_ln_defn.h,v $
236 * Revision 1.7 2006/02/25 00:53:48 egouvea
237 * Added the flag "-seed". If dither is being used and the seed is less
238 * than zero, the random number generator is initialized with time(). If
239 * it is at least zero, it's initialized with the provided seed. This way
240 * we have the benefit of having dither, and the benefit of being
243 * This is consistent with what sphinx3 does. Well, almost. The random
244 * number generator is still what the compiler provides.
246 * Also, moved fe_init_params to fe_interface.c, so one can initialize a
247 * variable of type param_t with meaningful values.
249 * Revision 1.6 2006/02/17 00:31:34 egouvea
250 * Removed switch -melwarp. Changed the default for window length to
251 * 0.025625 from 0.256 (so that a window at 16kHz sampling rate has
252 * exactly 410 samples). Cleaned up include's. Replaced some E_FATAL()
253 * with E_WARN() and return.
255 * Revision 1.5 2006/02/16 00:18:26 egouvea
256 * Implemented flexible warping function. The user can specify at run
257 * time which of several shapes they want to use. Currently implemented
258 * are an affine function (y = ax + b), an inverse linear (y = a/x) and a
259 * piecewise linear (y = ax, up to a frequency F, and then it "breaks" so
260 * Nyquist frequency matches in both scales.
262 * Added two switches, -warp_type and -warp_params. The first specifies
263 * the type, which valid values:
265 * -inverse or inverse_linear
267 * -piecewise or piecewise_linear
269 * The inverse_linear is the same as implemented by EHT. The -mel_warp
270 * switch was kept for compatibility (maybe remove it in the
271 * future?). The code is compatible with EHT's changes: cepstra created
272 * from code after his changes should be the same as now. Scripts that
273 * worked with his changes should work now without changes. Tested a few
274 * cases, same results.
276 * Revision 1.4 2006/02/14 20:56:54 eht
277 * Implement an argument -melwarp that changes the standard mel-scale
279 * M(f) = 2595 * log10( 1 + f/700 )
281 * M(f,w) = 2595 * log10( 1 + f/(700*w))
283 * So, 1.0 means no warp, w > 1.0 means linear compression w < 1.0 means
286 * Implement argument -nskip and -runlen arguments so that a subset of the
287 * utterances in the control file can be executed. Allows a simple
288 * distribution of wave2feat processing over N processors.
290 * Revision 1.3 2005/05/19 21:21:55 egouvea
291 * Bug #1176394: example bug
293 * Revision 1.2 2004/11/23 04:14:06 egouvea
294 * Fixed bug in cmd_ln.c in which a wrong boolean argument led into an
295 * infinite loop, and fixed the help and example strings, getting rid of
296 * spaces, so that the appearance is better.
298 * Revision 1.1 2004/09/09 17:59:30 egouvea
299 * Adding missing files to wave2feat