decoder.cpp

Go to the documentation of this file.
00001 //------------------------------------------------
00002 //              File: decoder.cpp                      
00003 //------------------------------------------------
00004 
00005 //Class for the decoder
00006 
00007 using namespace std;
00008 
00009 #include <iostream>
00010 #include <cstring>
00011 #include <string>
00012 
00013 #ifndef CODEFILEINCLUDED
00014 #include "codefile.cpp"
00015 #endif
00016 
00017 #ifndef REPOSITORYMANAGERINCLUDED
00018 #include "repositorymanager.cpp"
00019 #endif
00020 
00021 #ifndef WAVEFILEINCLUDED
00022 #include "wavefile.cpp"
00023 #endif
00024 
00025 #ifndef FRAMEINCLUDED
00026 #include "frame.cpp"
00027 #endif
00028 
00029 #ifndef PARAMETERSINCLUDED
00030 #include "parameters.cpp"
00031 #endif
00032 
00033 #define DECODERINCLUDED
00034 
00035 class decoder {
00036 
00037 private:
00038 
00039 public:
00040 
00041   int decode(string filename, string sfname)
00042   {
00043     //char* frmdata;
00044     //unsigned long int frsize;
00045     //cout<<"Enter the name of the code file that is to be processed by the decoder module";
00046     //cin>>filename;
00047     //filename="p3.a";
00048     //cout<<"Enter the name of the output speech file that is to be heard";
00049     // cin>>sfname;
00050     //sfname="p3d.wav";
00051     //extract email id from the code file
00052     codefile cf(filename);
00053     repositorymanager repmgr(cf.reademailid());
00054     //cout<<   cf.reademailid()<<endl; ///////////// 
00055     wavefile* wf=new wavefile();
00056     unsigned int code;
00057     string framename;
00058     //int count=0;
00059     while((code=cf.getcode())!=END_OF_CODESTREAM)
00060     {
00061       // cout<<code<<"\t";
00062       //count++;
00063       framename= repmgr.getFrameName(code);
00064       wf->appendFrame(framename); 
00065     }
00066     wf->makePerm(sfname);
00067     delete wf;
00068     //cout<<"Ended the decoder phase"<<endl;
00069     //exit(0);
00070     return 0;
00071   }
00072 
00073 };

Best viewed on Get Firefox!. Generated on Mon Mar 28 22:09:09 2005 for VoX by  doxygen 1.4.2 . This project hosted by SourceForge.net Logo .