2222#include " feat/wave-reader.h"
2323#include " cudamatrix/cu-matrix.h"
2424#include " cudamatrix/cu-vector.h"
25+
26+
2527int main (int argc, char *argv[]) {
2628 try {
2729 using namespace kaldi ;
@@ -66,7 +68,7 @@ int main(int argc, char *argv[]) {
6668 po.PrintUsage ();
6769 exit (1 );
6870 }
69-
71+
7072 g_cuda_allocator.SetOptions (g_allocator_options);
7173 CuDevice::Instantiate ().SelectGpuId (" yes" );
7274 CuDevice::Instantiate ().AllowMultithreading ();
@@ -76,7 +78,7 @@ int main(int argc, char *argv[]) {
7678
7779 std::string output_wspecifier = po.GetArg (2 );
7880
79- // Fbank is implemented via the MFCC code path
81+ // Fbank is implemented via the MFCC code path.
8082 CudaSpectralFeatures fbank (fbank_opts);
8183
8284 SequentialTableReader<WaveHolder> reader (wav_rspecifier);
@@ -88,7 +90,7 @@ int main(int argc, char *argv[]) {
8890 " needed if the vtln-map option is used." );
8991 RandomAccessBaseFloatReaderMapped vtln_map_reader (vtln_map_rspecifier,
9092 utt2spk_rspecifier);
91-
93+
9294 if (output_format == " kaldi" ) {
9395 if (!kaldi_writer.Open (output_wspecifier))
9496 KALDI_ERR << " Could not initialize output with wspecifier "
@@ -106,6 +108,11 @@ int main(int argc, char *argv[]) {
106108 num_utts++;
107109 std::string utt = reader.Key ();
108110 const WaveData &wave_data = reader.Value ();
111+ if (wave_data.SampFreq () != fbank_opts.frame_opts .samp_freq ) {
112+ KALDI_ERR << " File: " << utt << " has an mismatched sampling "
113+ << " rate (config= " << fbank_opts.frame_opts .samp_freq
114+ << " vs file=" << wave_data.SampFreq () << " ." ;
115+ }
109116 if (wave_data.Duration () < min_duration) {
110117 KALDI_WARN << " File: " << utt << " is too short ("
111118 << wave_data.Duration () << " sec): producing no output." ;
0 commit comments