tomwalters@6: // Copyright 2008-2010, Thomas Walters tomwalters@0: // tomwalters@0: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@0: // http://www.acousticscale.org/AIMC tomwalters@0: // tomwalters@45: // Licensed under the Apache License, Version 2.0 (the "License"); tomwalters@45: // you may not use this file except in compliance with the License. tomwalters@45: // You may obtain a copy of the License at tomwalters@0: // tomwalters@45: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@0: // tomwalters@45: // Unless required by applicable law or agreed to in writing, software tomwalters@45: // distributed under the License is distributed on an "AS IS" BASIS, tomwalters@45: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. tomwalters@45: // See the License for the specific language governing permissions and tomwalters@45: // limitations under the License. tomwalters@0: tomwalters@8: #include tomwalters@8: tomwalters@6: #include tomwalters@6: tomwalters@6: #include "Modules/Input/ModuleFileInput.h" tomwalters@6: #include "Modules/BMM/ModuleGammatone.h" tomwalters@6: #include "Modules/BMM/ModulePZFC.h" tomwalters@6: #include "Modules/NAP/ModuleHCL.h" tomwalters@46: #include "Modules/Strobes/ModuleLocalMax.h" tomwalters@6: #include "Modules/SAI/ModuleSAI.h" tomwalters@16: #include "Modules/SSI/ModuleSSI.h" tomwalters@16: #include "Modules/Profile/ModuleSlice.h" tomwalters@20: #include "Modules/Profile/ModuleScaler.h" tomwalters@6: #include "Modules/Features/ModuleGaussians.h" tomwalters@6: #include "Modules/Output/FileOutputHTK.h" tomwalters@46: #include "Modules/Output/FileOutputAIMC.h" tomwalters@6: tomwalters@8: int main(int argc, char* argv[]) { tomwalters@6: aimc::Parameters params; tomwalters@20: tomwalters@20: int buffer_length = 480; tomwalters@20: params.SetInt("input.buffersize", buffer_length); tomwalters@20: tomwalters@6: aimc::ModuleFileInput input(¶ms); tomwalters@52: aimc::ModulePZFC bmm(¶ms); tomwalters@46: aimc::FileOutputAIMC output(¶ms); tomwalters@6: tomwalters@6: std::string parameters_string = params.WriteString(); tomwalters@6: printf("%s", parameters_string.c_str()); tomwalters@6: tomwalters@6: input.AddTarget(&bmm); tomwalters@52: bmm.AddTarget(&output); tomwalters@6: tomwalters@46: output.OpenFile("test_output.aimc", params.GetFloat("sai.frame_period_ms")); tomwalters@6: if (input.LoadFile("test.wav")) { tomwalters@6: input.Process(); tomwalters@6: } else { tomwalters@6: printf("LoadFile failed"); tomwalters@6: } tomwalters@8: }