Example #1
0
 void mage_hts_engine_impl::do_initialize()
 {
   arg_list args;
   model_file_list dur_files(data_path,"dur");
   append_model_args(args,dur_files,"-td","-md");
   model_file_list mgc_files(data_path,"mgc",3);
   append_model_args(args,mgc_files,"-tm","-mm","-dm");
   model_file_list lf0_files(data_path,"lf0",3);
   append_model_args(args,lf0_files,"-tf","-mf","-df");
   model_file_list lpf_files(data_path,"lpf",1);
   append_model_args(args,lpf_files,"-tl","-ml","-dl");
   args.push_back(arg("-s",str::to_string(MAGE::defaultSamplingRate)));
   args.push_back(arg("-p",str::to_string(MAGE::defaultFrameRate)));
   args.push_back(arg("-a",str::to_string(MAGE::defaultAlpha)));
   args.push_back(arg("-b",str::to_string(beta.get())));
   args.push_back(arg("-u","0.5"));
   std::vector<char*> c_args;
   char name[]="RHVoice";
   c_args.push_back(name);
   for(arg_list::const_iterator it=args.begin();it!=args.end();++it)
     {
       c_args.push_back(const_cast<char*>(it->first.c_str()));
       c_args.push_back(const_cast<char*>(it->second.c_str()));
     }
   mage.reset(new MAGE::Mage("default",c_args.size(),&c_args[0]));
   vocoder.reset(new HTS106_Vocoder);
 }
 void mage_hts_engine_impl::do_initialize()
 {
   configure_for_sample_rate();
   std::string bpf_path(path::join(model_path,"bpf.txt"));
   if(!bpf_load(&bpf,bpf_path.c_str()))
     throw initialization_error();
   arg_list args;
   model_file_list dur_files(model_path,"dur");
   append_model_args(args,dur_files,"-td","-md");
   model_file_list mgc_files(model_path,"mgc",3);
   append_model_args(args,mgc_files,"-tm","-mm","-dm");
   model_file_list lf0_files(model_path,"lf0",3);
   append_model_args(args,lf0_files,"-tf","-mf","-df");
   model_file_list ap_files(model_path,"bap",3);
   append_model_args(args,ap_files,"-tl","-ml","-dl");
   args.push_back(arg("-s",str::to_string(sample_rate.get())));
   args.push_back(arg("-p",str::to_string(frame_shift)));
   args.push_back(arg("-a",str::to_string(alpha)));
   args.push_back(arg("-b",str::to_string(beta.get())));
   args.push_back(arg("-u","0.5"));
   std::vector<char*> c_args;
   char name[]="RHVoice";
   c_args.push_back(name);
   for(arg_list::const_iterator it=args.begin();it!=args.end();++it)
     {
       c_args.push_back(const_cast<char*>(it->first.c_str()));
       c_args.push_back(const_cast<char*>(it->second.c_str()));
     }
   mage.reset(new MAGE::Mage("default",c_args.size(),&c_args[0]));
   vocoder.reset(new HTS_Vocoder);
 }