示例#1
0
        public JuliusSession(string juliusExe, string juliusConf, string args, CancellationToken ct) : base(ct)
        {
            JuliusExe = juliusExe ?? throw new ArgumentNullException("juliusExe");

            JuliusConf = juliusConf ?? throw new ArgumentNullException("juliusConf");

            JuliusArgs = new string[] { $"-C {JuliusConf}", args };

            JuliusProcess = new ConsoleProcess(JuliusExe, JuliusArgs.ToArray(), onOutput: OnProcessOutput, onError: OnErrorOutput);

            Initialized = JuliusProcess.Initialized;
        }
示例#2
0
        public MimicSession(string mimicExe, string mimicText, string args, CancellationToken ct) : base(ct)
        {
            MimicExe = mimicExe ?? throw new ArgumentNullException("mimicExe");

            MimicText = mimicText ?? throw new ArgumentNullException("mimicText");

            MimicArgs = new string[] { $"-v -t \"{MimicText}\"", args };

            MimicProcess = new ConsoleProcess(MimicExe, MimicArgs.ToArray(), onOutput: OnProcessOutput, onError: OnErrorOutput);

            Initialized = MimicProcess.Initialized;
        }
示例#3
0
 public void Start()
 {
     if (IsStarted)
     {
         throw new InvalidOperationException("The Julius session is already started.");
     }
     else if (IsStopped)
     {
         JuliusProcess = new ConsoleProcess(JuliusExe, JuliusArgs.ToArray(), onOutput: OnProcessOutput, onError: OnErrorOutput);
     }
     JuliusProcess.Start();
     IsStarted = true;
 }