26 int main(
int argc,
char *argv[]) {
28 using namespace kaldi;
30 "Copy wave file or archives of wave files\n" 32 "Usage: wav-copy [options] <wav-rspecifier> <wav-wspecifier>\n" 33 " or: wav-copy [options] <wav-rxfilename> <wav-wxfilename>\n" 34 "e.g. wav-copy scp:wav.scp ark:-\n" 35 " wav-copy wav.ark:123456 -\n" 36 "See also: wav-to-duration extract-segments\n";
47 std::string wav_in_fn = po.
GetArg(1),
55 if (in_is_rspecifier != out_is_wspecifier)
56 KALDI_ERR <<
"Cannot mix archives with regular files";
58 if (in_is_rspecifier) {
64 for (; !wav_reader.
Done(); wav_reader.
Next()) {
68 KALDI_LOG <<
"Copied " << num_done <<
" wave files";
69 return (num_done != 0 ? 0 : 1);
72 Input ki(wav_in_fn, &binary);
73 Output ko(wav_out_fn, binary,
false);
84 }
catch(
const std::exception &e) {
85 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
bool Read(std::istream &is)
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
A templated class for writing objects to an archive or script file; see The Table concept...
void Write(const std::string &key, const T &value) const
int main(int argc, char *argv[])
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *rxfilename, RspecifierOptions *opts)
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...
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
WspecifierType ClassifyWspecifier(const std::string &wspecifier, std::string *archive_wxfilename, std::string *script_wxfilename, WspecifierOptions *opts)
int NumArgs() const
Number of positional parameters (c.f. argc-1).
std::string PrintableRxfilename(const std::string &rxfilename)
PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting...
std::string PrintableWxfilename(const std::string &wxfilename)
PrintableWxfilename turns the wxfilename into a more human-readable form for error reporting...
static bool Write(std::ostream &os, bool binary, const T &t)