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@318: // Licensed under the Apache License, Version 2.0 (the "License"); tomwalters@318: // you may not use this file except in compliance with the License. tomwalters@318: // You may obtain a copy of the License at tomwalters@268: // tomwalters@318: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@268: // tomwalters@318: // Unless required by applicable law or agreed to in writing, software tomwalters@318: // distributed under the License is distributed on an "AS IS" BASIS, tomwalters@318: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. tomwalters@318: // See the License for the specific language governing permissions and tomwalters@318: // limitations under the License. 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@320: #include "Modules/Strobes/ModuleLocalMax.h" tomwalters@278: #include "Modules/SAI/ModuleSAI.h" tomwalters@288: #include "Modules/SSI/ModuleSSI.h" tomwalters@288: #include "Modules/Profile/ModuleSlice.h" tomwalters@292: #include "Modules/Profile/ModuleScaler.h" tomwalters@278: #include "Modules/Features/ModuleGaussians.h" tomwalters@278: #include "Modules/Output/FileOutputHTK.h" tomwalters@320: #include "Modules/Output/FileOutputAIMC.h" tomwalters@278: tomwalters@280: int main(int argc, char* argv[]) { tomwalters@278: aimc::Parameters params; tomwalters@292: tomwalters@292: int buffer_length = 480; tomwalters@292: params.SetInt("input.buffersize", buffer_length); tomwalters@292: tomwalters@278: aimc::ModuleFileInput input(¶ms); tomwalters@330: aimc::ModulePZFC bmm(¶ms); tomwalters@320: aimc::FileOutputAIMC 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@330: bmm.AddTarget(&output); tomwalters@278: tomwalters@320: output.OpenFile("test_output.aimc", 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: }