From: Arnab G. <ar...@gm...> - 2012-08-19 11:14:17
|
That happens because you are using TableWriter to write the HTK features. This is to be used for writing Kaldi-style objects that are always stored as key-value pairs: in your case key my be the utterance ID and value being the actual features. You can find more information at: http://kaldi.sourceforge.net/io.html If you really need to write something that will be processed by a non-Kaldi tool that expects HTK-style feature files, you should directly open the file and write to it (you may want to use kaldi::Output). But note that the filenames cannot have "ark:" or "scp:" like qualifiers; the name will be treated as a literal. -Arnab On Sun, Aug 19, 2012 at 12:16 AM, Xavier Anguera <xan...@gm...> wrote: > Hi, > I have extracted the code below from some example file and I am trying > to make it write an HTK-compliant features file. > I almost make it, except that the file I get contains the HTK file > (readable by HList, all correst) with the preceding key I pass to > htk_writer (in my case the string "key", I tried passing it "" but it > complains). > Is there a way not to have the annoying key always written into the HTK file? > > Thanks! > > Xavier Anguera > > > > std::pair<Matrix<BaseFloat>, HtkHeader> p; > p.first.Resize(m_feats.NumRows(), m_feats.NumCols()); > p.first.CopyFromMat(m_feats); > HtkHeader header = { > m_feats.NumRows(), > (int)(m_mfcc_opts.frame_opts.frame_shift_ms * 10000), //shift > sizeof(float)*m_feats.NumCols(), > 011 > }; > > p.second = header; > > string outputFile = "ark:"; > outputFile += fileName; > TableWriter<HtkMatrixHolder> htk_writer(outputFile); > htk_writer.Write("key", p); > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Kaldi-developers mailing list > Kal...@li... > https://lists.sourceforge.net/lists/listinfo/kaldi-developers |