示例#1
0
        public static void Main(string[] args)
        {
            /*
             *
             * 726                     string[] resampler_arg_prefix = new string[] { "\"" + wavPath + "\"" };
             * 727                     string[] resampler_arg_suffix = new string[]{
             * 728                         "\"" + note + "\"",
             * 729                         "100",//<==VEL
             * 730                         "\"" + UtauPitchBendGenerator.FlagGener(target,item) + "\"",
             * 731                         (oa.msOffset+item.UstEvent.LeftLimit).ToString() + "",
             * 732                         millisec + "",
             * 733                         oa.msConsonant + "",
             * 734                         oa.msBlank + "",
             * 735                         item.UstEvent.getIntensity() + "",
             * 736                         item.UstEvent.getModuration() + "",
             * 737                         "!"+BASE_TEMPO + "" };
             * 738
             *
             *
             *
             */
            ArgsStruct p = ArgsParser.parseArgs(args);

            if (p == null)
            {
                ArgsParser.printUsage();
                return;
            }
            ArgsParser.printArgs(p);
        }
示例#2
0
        static void Main(string[] args)
        {
            ArgsStruct p = ArgsParser.parseArgs(args, false);

            if (p == null)
            {
                ArgsParser.printUsage();
                Console.WriteLine("Options: ");
                Console.WriteLine("\t--options-cropTime:<timedelay>\tto drop <timedelay> data before wavfile");
                Console.WriteLine("Commands:");
                Console.WriteLine("\t--command-flush\tSend a End Signal to tell server all is finished");
                return;
            }
            if (p.Commands.Contains("flush"))
            {
                SendEnd();
                return;
            }
            ArgsParser.printArgs(p);
            Console.WriteLine("---- Work As Pipe ----");
            Pipe_Client pclient = new Pipe_Client("VocalUtau.WavTool.PPC", 2000);

            pclient.LockWavFile();
            double delay = 0;

            if (p.Options.ContainsKey("croptime"))
            {
                double.TryParse(p.Options["croptime"], out delay);
            }
            pclient.Append(p.Inputfilename, p.Offset, p.Length, p.Ovr, p.PV, delay);
            pclient.Flush();
            pclient.UnLockWavFile();
            pclient.Dispose();
        }
示例#3
0
        public static void Main(string[] args)
        {
            ArgsStruct p = ArgsParser.parseArgs(args);

            if (p == null)
            {
                ArgsParser.printUsage();
                Console.WriteLine("Options:");
                Console.WriteLine("\t--options-split:true/false\tSet If SplitHeader As AnotherFile");
                return;
            }
            ArgsParser.printArgs(p);
            if (p.Options.ContainsKey("split"))
            {
                string sph = p.Options["split"];
                bool.TryParse(sph, out SplitHeader);
            }

            Console.WriteLine("---- Work Renew ----");
            Console.WriteLine("SplitHeader:{0}", SplitHeader);

            string mainformat = p.Outputfilename;
            string headformat = p.Outputfilename;
            uint   HeadLength = 0;
            long   DataLength = 0;

            if (SplitHeader)
            {
                mainformat += ".dat";
                headformat += ".whd";
                HeadLength  = (uint)Wave.NAudio.Extra.IOHelper.NormalPcmMono16_HeadLength;
            }
            using (System.IO.FileStream ofs = new FileStream(mainformat, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite))
            {
                Wave.WavAppender.AppendWork(ofs, p.Inputfilename, p.Offset, p.Length, p.Ovr, p.PV, HeadLength);
                DataLength = ofs.Length - HeadLength;
            }

            using (System.IO.FileStream hfs = new FileStream(headformat, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite))
            {
                byte[] br = Wave.NAudio.Extra.IOHelper.GenerateHead(Wave.NAudio.Extra.IOHelper.NormalPcmMono16_Format, (int)DataLength);
                hfs.Write(br, 0, br.Length);
            }
        }