27 using namespace kaldi;
30 "Reads an archive of features. If second argument is wxfilename, writes\n" 31 "the feature dimension of the first feature file; if second argument is\n" 32 "wspecifier, writes an archive of the feature dimension, indexed by utterance\n" 34 "Usage: feat-to-dim [options] <feat-rspecifier> (<dim-wspecifier>|<dim-wxfilename>)\n" 35 "e.g.: feat-to-dim scp:feats.scp -\n";
41 if (po.NumArgs() != 2) {
46 std::string rspecifier = po.GetArg(1);
47 std::string wspecifier_or_wxfilename = po.GetArg(2);
54 for (; !kaldi_reader.Done(); kaldi_reader.Next())
55 dim_writer.Write(kaldi_reader.Key(), kaldi_reader.Value().NumCols());
57 if (kaldi_reader.Done())
58 KALDI_ERR <<
"Could not read any features (empty archive?)";
59 Output ko(wspecifier_or_wxfilename,
false);
60 ko.Stream() << kaldi_reader.Value().NumCols() <<
"\n";
63 }
catch(
const std::exception &e) {
64 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
A templated class for writing objects to an archive or script file; see The Table concept...
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
WspecifierType ClassifyWspecifier(const std::string &wspecifier, std::string *archive_wxfilename, std::string *script_wxfilename, WspecifierOptions *opts)