Exemplo n.º 1
0
 public Singer(string dir)
 {
     Dir = dir;
     CheckVoicebank();
     if (!IsEnabled)
     {
         return;
     }
     CharLoad();
     Pitchmap = new Pitchmap(Dir);
     Colormap = new Colormap(Dir);
     Load();
 }
Exemplo n.º 2
0
 public void Load()
 {
     Otos = new List <Oto> {
     };
     foreach (string sub in Subs)
     {
         string filename = Path.Combine(Dir, sub, "oto.ini");
         if (File.Exists(filename))
         {
             string[] lines = File.ReadAllLines(filename);
             foreach (string line in lines)
             {
                 string pattern = "(.*)=(.*),(.*),(.*),(.*),(.*),(.*)";
                 var    arr     = Regex.Split(line, pattern);
                 double temp;
                 if (arr.Length == 1)
                 {
                     continue;
                 }
                 Oto Oto = new Oto()
                 {
                     File         = arr[1],
                     Alias        = arr[2],
                     Offset       = double.TryParse(arr[3], out temp) ? temp : 0,
                     Consonant    = double.TryParse(arr[4], out temp) ? temp : 0,
                     Cutoff       = double.TryParse(arr[5], out temp) ? temp : 0,
                     Preutterance = double.TryParse(arr[6], out temp) ? temp : 0,
                     Overlap      = double.TryParse(arr[7], out temp) ? temp : 0,
                 };
                 Oto = Pitchmap.Substract(Oto);
                 Oto = Colormap.Substract(Oto);
                 Otos.Add(Oto);
             }
         }
         else
         {
             File.Create(filename);
         }
     }
 }
Exemplo n.º 3
0
 public UColor(string name, string suffix, int r, int g, int b, string pitchmap)
     : this(name, suffix, r, g, b)
 {
     Pitchmap = new Pitchmap(pitchmap);
 }