コード例 #1
0
ファイル: SpeechFile.cs プロジェクト: emote-project/Scenario1
 public static void SaveSpeechDB(string filename, SpeechDB speechFile)
 {
     using (StreamWriter file = File.CreateText(filename))
     {
         JsonSerializer serializer = new JsonSerializer();
         serializer.Formatting = Formatting.Indented;
         serializer.Serialize(file, speechFile);
     }
 }
コード例 #2
0
ファイル: SpeechFile.cs プロジェクト: emote-project/Scenario1
 public static SpeechDB CreateExampleFile()
 {
     SpeechDB speechExample = new SpeechDB();
     for (int i = 0; i < 3; i++)
     {
         SpeechAct sa = new SpeechAct();
         sa.SpeechType = "SpeechType" + i;
         for(int j=0; j<3; j++) {
             sa.Speech.Add("Speech " + j + " for " + sa.SpeechType);
         }
         for(int j=0; j<3; j++) {
             SpeechTag st = new SpeechTag();
             st.ParameterName = "SpeechTag" + j + sa.SpeechType;
             st.Tag = "ST" + i.ToString() + j.ToString();
             sa.Tags.Add(st);
         }
         speechExample.SpeechActs.Add(sa);
     }
     return speechExample;
 }