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; }
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; }
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; }