Mercurial > hg > aimc
comparison trunk/src/Main/aimc.cc @ 278:5b8b9ea1218a
- Added a basic main function to test that all the can be fitted together
- Fixed an initialisation bug in ModuleFileInput that left the buffer size at zero
- Added proper description strings to the input and output modules
- Fixed an out-by-a-factor-of-1000 bug in the SAI memory allocation (oops)
- Added LOG_INFO_NN fucnction to log without a newline. Useful for the ASCII art module chain in aimc.cc.
author | tomwalters |
---|---|
date | Thu, 18 Feb 2010 19:35:07 +0000 |
parents | c26222c51fb7 |
children | e55d0c225a57 |
comparison
equal
deleted
inserted
replaced
277:6b4921704eb1 | 278:5b8b9ea1218a |
---|---|
1 // Copyright 2006-2010, Thomas Walters | 1 // Copyright 2008-2010, Thomas Walters |
2 // | 2 // |
3 // AIM-C: A C++ implementation of the Auditory Image Model | 3 // AIM-C: A C++ implementation of the Auditory Image Model |
4 // http://www.acousticscale.org/AIMC | 4 // http://www.acousticscale.org/AIMC |
5 // | 5 // |
6 // This program is free software: you can redistribute it and/or modify | 6 // This program is free software: you can redistribute it and/or modify |
14 // GNU General Public License for more details. | 14 // GNU General Public License for more details. |
15 // | 15 // |
16 // You should have received a copy of the GNU General Public License | 16 // You should have received a copy of the GNU General Public License |
17 // along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 // along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
19 int main () { | 19 #include <string> |
20 // TODO | 20 |
21 #include <stdlib.h> | |
22 | |
23 #include "Modules/Input/ModuleFileInput.h" | |
24 #include "Modules/BMM/ModuleGammatone.h" | |
25 #include "Modules/BMM/ModulePZFC.h" | |
26 #include "Modules/NAP/ModuleHCL.h" | |
27 #include "Modules/Strobes/ModuleParabola.h" | |
28 #include "Modules/SAI/ModuleSAI.h" | |
29 //#include "Modules/SSI/ModuleSSI.h" | |
30 //#include "Modules/Profile/ModuleProfile.h" | |
31 #include "Modules/Features/ModuleGaussians.h" | |
32 #include "Modules/Output/FileOutputHTK.h" | |
33 | |
34 int main (int argc, char* argv[]) { | |
35 aimc::Parameters params; | |
36 aimc::ModuleFileInput input(¶ms); | |
37 //aimc::ModuleGammatone bmm(¶ms); | |
38 aimc::ModulePZFC bmm(¶ms); | |
39 aimc::ModuleHCL nap(¶ms); | |
40 aimc::ModuleParabola strobes(¶ms); | |
41 aimc::ModuleSAI sai(¶ms); | |
42 //aimc::ModuleSSI ssi(¶ms); | |
43 //aimc::ModuleProfile profile(¶ms); | |
44 aimc::ModuleGaussians features(¶ms); | |
45 aimc::FileOutputHTK output(¶ms); | |
46 | |
47 std::string parameters_string = params.WriteString(); | |
48 printf("%s", parameters_string.c_str()); | |
49 | |
50 input.AddTarget(&bmm); | |
51 bmm.AddTarget(&nap); | |
52 nap.AddTarget(&strobes); | |
53 strobes.AddTarget(&sai); | |
54 sai.AddTarget(&features); | |
55 //ssi.AddTarget(&profile); | |
56 //profile.AddTarget(&features); | |
57 features.AddTarget(&output); | |
58 | |
59 output.OpenFile("test_output.htk", params.GetFloat("sai.frame_period_ms")); | |
60 if (input.LoadFile("test.wav")) { | |
61 input.Process(); | |
62 } else { | |
63 printf("LoadFile failed"); | |
64 } | |
21 } | 65 } |