void Initialize() { if (_decoderProcess != null) { return; } _decoderProcess = new Process(); _decoderProcess.StartInfo.FileName = m_settings.Path; _decoderProcess.StartInfo.Arguments = m_settings.Parameters.Replace("%I", "\"" + _path + "\""); _decoderProcess.StartInfo.CreateNoWindow = true; _decoderProcess.StartInfo.RedirectStandardOutput = true; _decoderProcess.StartInfo.UseShellExecute = false; bool started = false; Exception ex = null; try { started = _decoderProcess.Start(); if (started) { _decoderProcess.PriorityClass = Process.GetCurrentProcess().PriorityClass; } } catch (Exception _ex) { ex = _ex; } if (!started) { _decoderProcess = null; throw new Exception(m_settings.Path + ": " + (ex == null ? "please check the path" : ex.Message)); } rdr = new WAV.AudioDecoder(new WAV.DecoderSettings(), _path, _decoderProcess.StandardOutput.BaseStream); }
public AudioDecoder(DecoderSettings settings, string path, Stream IO) { m_settings = settings; _path = path; _decoderProcess = null; rdr = null; }