tomwalters@278: // Copyright 2008-2010, Thomas Walters tomwalters@268: // tomwalters@268: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@268: // http://www.acousticscale.org/AIMC tomwalters@268: // tomwalters@268: // This program is free software: you can redistribute it and/or modify tomwalters@268: // it under the terms of the GNU General Public License as published by tomwalters@268: // the Free Software Foundation, either version 3 of the License, or tomwalters@268: // (at your option) any later version. tomwalters@268: // tomwalters@268: // This program is distributed in the hope that it will be useful, tomwalters@268: // but WITHOUT ANY WARRANTY; without even the implied warranty of tomwalters@268: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the tomwalters@268: // GNU General Public License for more details. tomwalters@268: // tomwalters@268: // You should have received a copy of the GNU General Public License tomwalters@268: // along with this program. If not, see . tomwalters@268: tomwalters@280: #include tomwalters@280: tomwalters@278: #include tomwalters@278: tomwalters@278: #include "Modules/Input/ModuleFileInput.h" tomwalters@278: #include "Modules/BMM/ModuleGammatone.h" tomwalters@278: #include "Modules/BMM/ModulePZFC.h" tomwalters@278: #include "Modules/NAP/ModuleHCL.h" tomwalters@278: #include "Modules/Strobes/ModuleParabola.h" tomwalters@278: #include "Modules/SAI/ModuleSAI.h" tomwalters@288: #include "Modules/SSI/ModuleSSI.h" tomwalters@288: #include "Modules/Profile/ModuleSlice.h" tomwalters@278: #include "Modules/Features/ModuleGaussians.h" tomwalters@278: #include "Modules/Output/FileOutputHTK.h" tomwalters@278: tomwalters@280: int main(int argc, char* argv[]) { tomwalters@278: aimc::Parameters params; tomwalters@278: aimc::ModuleFileInput input(¶ms); tomwalters@288: aimc::ModuleGammatone bmm(¶ms); tomwalters@288: //aimc::ModulePZFC bmm(¶ms); tomwalters@278: aimc::ModuleHCL nap(¶ms); tomwalters@278: aimc::ModuleParabola strobes(¶ms); tomwalters@278: aimc::ModuleSAI sai(¶ms); tomwalters@288: aimc::ModuleSSI ssi(¶ms); tomwalters@288: aimc::ModuleSlice profile(¶ms); tomwalters@278: aimc::ModuleGaussians features(¶ms); tomwalters@278: aimc::FileOutputHTK output(¶ms); tomwalters@278: tomwalters@278: std::string parameters_string = params.WriteString(); tomwalters@278: printf("%s", parameters_string.c_str()); tomwalters@278: tomwalters@278: input.AddTarget(&bmm); tomwalters@278: bmm.AddTarget(&nap); tomwalters@278: nap.AddTarget(&strobes); tomwalters@278: strobes.AddTarget(&sai); tomwalters@288: sai.AddTarget(&ssi); tomwalters@288: ssi.AddTarget(&profile); tomwalters@288: profile.AddTarget(&features); tomwalters@278: features.AddTarget(&output); tomwalters@278: tomwalters@278: output.OpenFile("test_output.htk", params.GetFloat("sai.frame_period_ms")); tomwalters@278: if (input.LoadFile("test.wav")) { tomwalters@278: input.Process(); tomwalters@278: } else { tomwalters@278: printf("LoadFile failed"); tomwalters@278: } tomwalters@280: }