Mercurial > hg > aimc
comparison trunk/src/Modules/Output/FileOutputHTK.cc @ 289:6cf55200a199
-Added basic support for unit tests using gtest
-Updated lint scripts to exclude header guard problems
-Made everything lint-friendly
-Added a trivial script to build the Doxygen documentation
author | tomwalters |
---|---|
date | Sat, 20 Feb 2010 21:03:57 +0000 |
parents | e55d0c225a57 |
children | 10d0803e37ec |
comparison
equal
deleted
inserted
replaced
288:34993448961f | 289:6cf55200a199 |
---|---|
45 module_type_ = "output"; | 45 module_type_ = "output"; |
46 module_version_ = "$Id$"; | 46 module_version_ = "$Id$"; |
47 | 47 |
48 file_handle_ = NULL; | 48 file_handle_ = NULL; |
49 header_written_ = false; | 49 header_written_ = false; |
50 filename_[0] = '\0'; | |
51 frame_period_ms_ = 0.0f; | 50 frame_period_ms_ = 0.0f; |
52 } | 51 } |
53 | 52 |
54 FileOutputHTK::~FileOutputHTK() { | 53 FileOutputHTK::~FileOutputHTK() { |
55 if (file_handle_ != NULL) | 54 if (file_handle_ != NULL) |
65 // Check that the output file exists and is writeable | 64 // Check that the output file exists and is writeable |
66 if ((file_handle_ = fopen(filename, "wb")) == NULL) { | 65 if ((file_handle_ = fopen(filename, "wb")) == NULL) { |
67 LOG_ERROR(_T("Couldn't open output file '%s' for writing."), filename); | 66 LOG_ERROR(_T("Couldn't open output file '%s' for writing."), filename); |
68 return false; | 67 return false; |
69 } | 68 } |
70 strcpy(filename_, filename); | |
71 sample_count_ = 0; | 69 sample_count_ = 0; |
72 frame_period_ms_ = frame_period_ms; | 70 frame_period_ms_ = frame_period_ms; |
73 header_written_ = false; | 71 header_written_ = false; |
74 return true; | 72 return true; |
75 } | 73 } |
113 | 111 |
114 // To be filled in when the file is done | 112 // To be filled in when the file is done |
115 int32_t sample_count = 0; | 113 int32_t sample_count = 0; |
116 | 114 |
117 int32_t sample_period = floor(1e4 * period_ms); | 115 int32_t sample_period = floor(1e4 * period_ms); |
118 int16_t sample_size = num_elements * sizeof(float); | 116 int16_t sample_size = num_elements * sizeof(float); // NOLINT |
119 | 117 |
120 // User-defined coefficients with energy term | 118 // User-defined coefficients with energy term |
121 int16_t parameter_kind = H_USER + H_E; | 119 int16_t parameter_kind = H_USER + H_E; |
122 | 120 |
123 // Fix endianness | 121 // Fix endianness |