annotate src/Main/aimc.cc @ 70:fdf7f3bbcf81

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