int main(int argc, char **argv) {
	if (argc!=7) {
		printf("Usage: this.exe hsKind covKind nStates mixes paraKind streamList\n");
		printf("hsKind : P(?)\n");
		printf("covKind : InvDiagC/DiagC/FullC\n");
		printf("nStates : 1(3,5)\n");
		printf("mixes, mixes for each stream: \"6 6 6\"(3 streams here)\n");
		printf("paraKind : MFCC_E_D_A_Z(case-by-case)\n");
		printf("streamList, feature dimension for each stream : \"13 13 13\"(also 3 streams here)\n");
		exit(-1);
	}

	char hsKind[2];//=P
	char covKind[10];//=D
	int nStates;//=3
	char paraKind[100];//=MFCC_E_D_A_Z

	sscanf(argv[1],"%s", &hsKind);
	sscanf(argv[2],"%s", &covKind);
	sscanf(argv[3],"%d", &nStates);
	sscanf(argv[5],"%s", &paraKind);

	//u must copy static argv[4] into a modifiable memory like tmpstr, if you use strtok();
	
	String strobj(1000);
	
  StringArray list_stream(100, 10, 10);
	int nStreams = strobj.split(argv[6], " ", &list_stream);

  StringArray list_mix(nStreams, 10, 10);
	int nMix = strobj.split(argv[4], " ", &list_mix);

    if (nStreams!=nMix)
    {
        printf("number of streams not the same as number of mixtures\n");
	    exit(1);
	}
	int* mixes = new int[nStreams];
	int* sWidths = new int[nStreams];//=13 13 13
	int vecSize = 0; 
	for (int i=0;i<nStreams;i++)
	{
		mixes[i] = atoi(list_mix.rowAt(i));
		sWidths[i]=atoi(list_stream.rowAt(i));
        vecSize += sWidths[i];
	}
	
	outMacroTxt(hsKind, covKind, nStates, nStreams, sWidths, mixes, paraKind, vecSize) ;
	delete mixes;
	delete sWidths;
    exit(0);    
}
Пример #2
0
	std::string getversion()	{ return strobj() << VERSION_MAJOR << "." << VERSION_MINOR << "." << VERSION_PATCH; }