/// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            string svmDir = "svm";
            string scaledSVMDir = "scaledSVM";
            Directory.CreateDirectory(svmDir);
            Directory.CreateDirectory(scaledSVMDir);

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);

                string waveId = row["WaveID"].String;
                string svmFile = JobBase.GenerateLocalFile(waveId, row["SVM"].String, FileExtensions.Text, false, svmDir);
                string scaledSVMFile = Path.Combine(scaledSVMDir, waveId + "." + FileExtensions.Text);
                string svmRangeFile = Path.GetFileName(this.Job.ReplaceVariable["SVMRANGE"]);

                // File.WriteAllText(svmRangeFile, TmocFile.NormalizeOutput(svmRangeFile)).
                string argument = Helper.NeutralFormat(" -r \"{0}\" \"{1}\"", svmRangeFile, svmFile);
                DelayedLogger logger = new DelayedLogger(new TextLogger(scaledSVMFile));
                CommandLine.RunCommand(Path.GetFileName(this.Job.ReplaceVariable["SVMSCALETOOL"]),
                    argument, Environment.CurrentDirectory, logger.Writer, logger.Writer, null);
                logger.Dispose();
                outputRow["SSVM"].Set(File.ReadAllText(scaledSVMFile));

                yield return outputRow;
            }
        }
 public DataLoggerConsumer(DelayedLogger delayedLogger)
 {
     _delayedLogger = delayedLogger;
 }
示例#3
0
        private static void DeleteData(object arg)
        {
            DataDeleteArgument deleteArg = arg as DataDeleteArgument;
            if (deleteArg == null)
            {
                throw new ArgumentException("Invalid argument in DeleteData method");
            }

            using (DelayedLogger fileWriter = new DelayedLogger(deleteArg.Logger))
            {
                string log = deleteArg.Description;

                if (Microsoft.Tts.Cosmos.TMOC.TmocDirectory.Exists(deleteArg.DataFullPath))
                {
                    Microsoft.Tts.Cosmos.TMOC.TmocDirectory.Delete(deleteArg.DataFullPath);
                }
                else
                {
                    Microsoft.Tts.Cosmos.TMOC.TmocFile.Delete(deleteArg.DataFullPath);
                }

                Console.WriteLine("{0}", log);
                fileWriter.Writer.WriteLine("{0}", log);
            }
        }