annotate trunk/src/Main/aimc.cc @ 706:f8e90b5d85fd tip

Delete CARFAC code from this repository. It has been moved to https://github.com/google/carfac Please email me with your github username to get access. I've also created a new mailing list to discuss CARFAC development: https://groups.google.com/forum/#!forum/carfac-dev
author ronw@google.com
date Thu, 18 Jul 2013 20:56:51 +0000
parents 0a8e7d0c70dc
children
rev   line source
tomwalters@278 1 // Copyright 2008-2010, Thomas Walters
tomwalters@268 2 //
tomwalters@268 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@268 4 // http://www.acousticscale.org/AIMC
tomwalters@268 5 //
tomwalters@318 6 // Licensed under the Apache License, Version 2.0 (the "License");
tomwalters@318 7 // you may not use this file except in compliance with the License.
tomwalters@318 8 // You may obtain a copy of the License at
tomwalters@268 9 //
tomwalters@318 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@268 11 //
tomwalters@318 12 // Unless required by applicable law or agreed to in writing, software
tomwalters@318 13 // distributed under the License is distributed on an "AS IS" BASIS,
tomwalters@318 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tomwalters@318 15 // See the License for the specific language governing permissions and
tomwalters@318 16 // limitations under the License.
tomwalters@268 17
tomwalters@280 18 #include <stdlib.h>
tomwalters@280 19
tomwalters@278 20 #include <string>
tomwalters@278 21
tomwalters@278 22 #include "Modules/Input/ModuleFileInput.h"
tomwalters@278 23 #include "Modules/BMM/ModuleGammatone.h"
tomwalters@278 24 #include "Modules/BMM/ModulePZFC.h"
tomwalters@278 25 #include "Modules/NAP/ModuleHCL.h"
tomwalters@320 26 #include "Modules/Strobes/ModuleLocalMax.h"
tomwalters@278 27 #include "Modules/SAI/ModuleSAI.h"
tomwalters@288 28 #include "Modules/SSI/ModuleSSI.h"
tomwalters@288 29 #include "Modules/Profile/ModuleSlice.h"
tomwalters@292 30 #include "Modules/Profile/ModuleScaler.h"
tomwalters@278 31 #include "Modules/Features/ModuleGaussians.h"
tomwalters@278 32 #include "Modules/Output/FileOutputHTK.h"
tomwalters@320 33 #include "Modules/Output/FileOutputAIMC.h"
tomwalters@278 34
tomwalters@280 35 int main(int argc, char* argv[]) {
tomwalters@278 36 aimc::Parameters params;
tomwalters@292 37
tomwalters@292 38 int buffer_length = 480;
tomwalters@292 39 params.SetInt("input.buffersize", buffer_length);
tomwalters@292 40
tomwalters@278 41 aimc::ModuleFileInput input(&params);
tomwalters@330 42 aimc::ModulePZFC bmm(&params);
tomwalters@320 43 aimc::FileOutputAIMC output(&params);
tomwalters@278 44
tomwalters@278 45 std::string parameters_string = params.WriteString();
tomwalters@278 46 printf("%s", parameters_string.c_str());
tomwalters@278 47
tomwalters@278 48 input.AddTarget(&bmm);
tomwalters@330 49 bmm.AddTarget(&output);
tomwalters@278 50
tomwalters@320 51 output.OpenFile("test_output.aimc", params.GetFloat("sai.frame_period_ms"));
tomwalters@278 52 if (input.LoadFile("test.wav")) {
tomwalters@278 53 input.Process();
tomwalters@278 54 } else {
tomwalters@278 55 printf("LoadFile failed");
tomwalters@278 56 }
tomwalters@280 57 }