Beispiel #1
0
        public void GenerateDataFile(string fileName, string captionNode, string audioNode, string triggerNode)
        {
            CaptionData cd = new CaptionData(fileName);

            cd.Captions    = ReadDataFromXML(captionNode);
            cd.AudioName   = ReadDataFromXML(audioNode);
            cd.TriggerTime = ReadDataFromXML(triggerNode);
            cd.CaptionConfig.Add(cd.Captions);
            cd.CaptionConfig.Add(cd.AudioName);
            cd.CaptionConfig.Add(cd.TriggerTime);

            FileStream   fs = new FileStream(outputPath + fileName, FileMode.OpenOrCreate, FileAccess.Write);
            BinaryWriter bw = new BinaryWriter(fs);

            bw.Write(cd.Captions.Count.ToString());

            foreach (string captionWord in cd.Captions)
            {
                bw.Write(captionWord);
                //sw.WriteLine(captionWord);
            }
            Debug.Log("Write done!");
            fs.Close();
            bw.Close();
        }
Beispiel #2
0
        public void GenerateDataFile(string fileName, string nodeName)
        {
            CaptionData cd = new CaptionData(fileName);

            cd.Captions = ReadDataFromXML(nodeName);

            FileStream fs = new FileStream(outputPath + fileName, FileMode.OpenOrCreate, FileAccess.Write);
//			StreamWriter sw = new StreamWriter(fs);
            BinaryWriter bw = new BinaryWriter(fs);

            bw.Write(cd.Captions.Count.ToString());

            foreach (string captionWord in cd.Captions)
            {
                bw.Write(captionWord);
                //sw.WriteLine(captionWord);
            }
            Debug.Log("Write done!");
            fs.Close();
            bw.Close();
        }