SphinxBase 5prealpha
cmd_ln_defn.h
1/* ====================================================================
2 * Copyright (c) 1998-2000 Carnegie Mellon University. All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
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
15 * distribution.
16 *
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.
20 *
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.
32 *
33 * ====================================================================
34 *
35 */
36/*********************************************************************
37 *
38 * File: cmd_ln_defn.h
39 *
40 * Description:
41 * Command line argument definition
42 *
43 * Author:
44 *
45 *********************************************************************/
46
47#ifndef CMD_LN_DEFN_H
48#define CMD_LN_DEFN_H
49
50#include <sphinxbase/cmd_ln.h>
51#include <sphinxbase/fe.h>
52
53const char helpstr[] =
54 "Description: \n\
55Extract acoustic features form from audio file.\n\
56\n\
57The main parameters that affect the final output, with typical values, are:\n\
58\n\
59samprate, typically 8000, 11025, or 16000\n\
60lowerf, 130, 200, 130, for the respective sampling rates above\n\
61upperf, 3700, 5200, 6800, for the respective sampling rates above\n\
62nfilt, 31, 37, 40, for the respective sampling rates above\n\
63nfft, 256 or 512\n\
64format, raw or nist or mswav\n\
65\"";
66
67const char examplestr[] =
68 "Example: \n\
69This 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\
70\n\
71sphinx_fe -i input.raw \n\
72 -o output.mfc \n\
73 -input_endian little \n\
74 -samprate 16000 \n\
75 -lowerf 130 \n\
76 -upperf 6800 \n\
77 -nfilt 40 \n\
78 -nfft 512";
79
80static arg_t defn[] = {
81 { "-help",
83 "no",
84 "Shows the usage of the tool"},
85
86 { "-example",
88 "no",
89 "Shows example of how to use the tool"},
90
91 waveform_to_cepstral_command_line_macro(),
92
93 { "-argfile",
95 NULL,
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." },
97
98 { "-i",
100 NULL,
101 "Single audio input file" },
102
103 { "-o",
105 NULL,
106 "Single cepstral output file" },
107
108 { "-c",
110 NULL,
111 "Control file for batch processing" },
112
113 { "-nskip",
114 ARG_INT32,
115 "0",
116 "If a control file was specified, the number of utterances to skip at the head of the file" },
117
118 { "-runlen",
119 ARG_INT32,
120 "-1",
121 "If a control file was specified, the number of utterances to process, or -1 for all" },
122
123 { "-part",
124 ARG_INT32,
125 "0",
126 "Index of the part to run (supersedes -nskip and -runlen if non-zero)" },
127
128 { "-npart",
129 ARG_INT32,
130 "0",
131 "Number of parts to run in (supersedes -nskip and -runlen if non-zero)" },
132
133 { "-di",
135 NULL,
136 "Input directory, input file names are relative to this, if defined" },
137
138 { "-ei",
140 NULL,
141 "Input extension to be applied to all input files" },
142
143 { "-do",
145 NULL,
146 "Output directory, output files are relative to this" },
147
148 { "-eo",
150 NULL,
151 "Output extension to be applied to all output files" },
152
153 { "-build_outdirs",
155 "yes",
156 "Create missing subdirectories in output directory" },
157
158 { "-sph2pipe",
160 "no",
161 "Input is NIST sphere (possibly with Shorten), use sph2pipe to convert" },
162
163 { "-nist",
165 "no",
166 "Defines input format as NIST sphere" },
167
168 { "-raw",
170 "no",
171 "Defines input format as raw binary data" },
172
173 { "-mswav",
175 "no",
176 "Defines input format as Microsoft Wav (RIFF)" },
177
178 { "-nchans",
179 ARG_INT32,
180 "1",
181 "Number of channels of data (interlaced samples assumed)" },
182
183 { "-whichchan",
184 ARG_INT32,
185 "0",
186 "Channel to process (numbered from 1), or 0 to mix all channels" },
187
188 { "-ofmt",
190 "sphinx",
191 "Format of output files - one of sphinx, htk, text." },
192
193 { "-mach_endian",
195#ifdef WORDS_BIGENDIAN
196 "big",
197#else
198 "little",
199#endif
200 "Endianness of machine, big or little" },
201
202 { "-blocksize",
203 ARG_INT32,
204 "2048",
205 "Number of samples to read at a time." },
206
207 { "-spec2cep",
209 "no",
210 "Input is log spectral files, output is cepstral files" },
211
212 { "-cep2spec",
214 "no",
215 "Input is cepstral files, output is log spectral files" },
216
217 { NULL, 0, NULL, NULL }
218};
219
220
221#define CMD_LN_DEFN_H
222
223#endif /* CMD_LN_DEFN_H */
Command-line and other configurationparsing and handling.
#define ARG_STRING
String argument (optional).
Definition cmd_ln.h:114
#define ARG_INT32
Definition cmd_ln.h:144
#define ARG_BOOLEAN
Boolean (true/false) argument (optional).
Definition cmd_ln.h:118
Argument definition structure.